A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/yyuu/pyenv/wiki/Common-build-problems below:

Common build problems · pyenv/pyenv Wiki · GitHub

First of all, make sure you have installed Python's dependencies and build tools as per https://github.com/pyenv/pyenv/wiki#suggested-build-environment , before any further troubleshooting.

Open the build log (the path to it is printed after the "BUILD FAILED" message) and look for any error messages in it (they are usually marked with the word "error"). If there are many error messages, the earliest one typically points to the root cause.

If your error message is not listed in the below table of contents (TOC), try searching this page for the message's parts (best for parts that would likely remain the same between distributions and library versions). If multiple different error messages have the same cause, we list them in the corresponding section's text rather than in the TOC.

Below are some alternative packages that are not in the recommended set and should generally only be considered when there are special needs and/or problems with those in it. <!- Updates to the recommended set should go on the above link rather than here! ->

Removing a python version manually
rm -rf ~/.pyenv/versions/"X.Y.Z"

Where "X.Y.Z" is the version that you want to remove. To list installed versions:

Installing a 32 bit python on 64 bit Mac OS X (this will not work on Linux)
CONFIGURE_OPTS="--with-arch=i386" CFLAGS="-arch i386" LDFLAGS="-arch i386" python-build options
Installing a system-wide Python

If you want to install a Python interpreter that's available to all users and system scripts (no pyenv), use /usr/local/ as the install path. For example:

sudo python-build 3.3.2 /usr/local/
Build failed - bad interpreter: Permission denied

If you encounter this error while installing python and your server is a VPS, the /tmp directory where python-build download and compile the packages is probably mounted as noexec. You can check with your hosting provider if whether they provide a way to bypass this protection.

If the answer is no, just set the $TMPDIR environment variable to wherever you have a write + execution rights. For example:

export TMPDIR="$HOME/src"

Please note you'll have to do it every time you'll want to install a new version of python unless you write this command in your ~/.bashrc.

If you've got something like that:

$ pyenv install 2.7.5
Downloading http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz...
Installing yaml-0.1.4...

BUILD FAILED

Please, make sure that "make" is installed ($ sudo apt-get install make). In Ubuntu Server, by default, it isn't.

Build failed: "ERROR: The Python zlib extension was not compiled. Missing the zlib?"
Installing Python-2.7.7...

ERROR: The Python zlib extension was not compiled. Missing the zlib?

Please consult to the Wiki page to fix the problem.
https://github.com/pyenv/pyenv/wiki/Common-build-problems

BUILD FAILED
CPPFLAGS="-I$(xcrun -show-sdk-path)/usr/include" pyenv install -v 2.7.7
CPPFLAGS="-I$(brew --prefix zlib)/include" pyenv install -v 3.7.0

If you experience both issues with openssl and zlib, you can specify both search paths as a compiler flag:

CPPFLAGS="-I$(brew --prefix openssl)/include -I$(xcrun -show-sdk-path)/usr/include" LDFLAGS="-L$(brew --prefix openssl)/lib"

If you experience issues with readline, you can also specify this as a compiler flag:

CPPFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix readline)/include -I$(xcrun -show-sdk-path)/usr/include" LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix readline)/lib"

If you are using macOS 10.14.6 with XCode 10.3, add the following:

SDKROOT=${XCODE_ROOT}/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk \
MACOSX_DEPLOYMENT_TARGET=10.14

If you are using Ubuntu/Debian, you need the following packages:

sudo apt install zlib1g zlib1g-dev libssl-dev libbz2-dev libsqlite3-dev
Build failed: Resource temporarily unavailable

If you see the string "resource temporarily unavailable" (often after "fork: "), then you may be on a shared host or other machine with low resource limits. Try running only a single job at a time to reduce resource usage:

MAKE_OPTS='-j 1' pyenv install 3.12.1
ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib? 1. OpenSSL is installed to an uncommon location.

Pass the location of its headers and libraries explicitly: (the openssl folder can be found by running openssl version -d)

CPPFLAGS="-I<openssl install prefix>/include" \
LDFLAGS="-L<openssl install prefix>/lib" \
pyenv install -v <python version>

or, alternatively, for Python 3.7+, instead of CPPFLAGS and LDFLAGS:

CONFIGURE_OPTS="--with-openssl=<openssl install prefix>"

or

LDFLAGS="-Wl,-rpath,<openssl install prefix>/lib" \
CONFIGURE_OPTS="--with-openssl=<openssl install prefix>" \
pyenv install -v <python version>

For python >= 3.10, add --with-openssl-rpath flag

LDFLAGS="-Wl,-rpath,<openssl install prefix>/lib" \
CONFIGURE_OPTS="--with-openssl=<openssl install prefix> --with-openssl-rpath=auto" \
pyenv install -v <python version>

E.g. (invocations that worked for various people):

2. Your OpenSSL version is incompatible with the Python version you're trying to install

Old Python versions (for CPython, <3.5.3 and <2.7.13) require OpenSSL 1.0 while newer systems provide 1.1, and vice versa.
Note that OpenSSL 1.0 is EOL and by now practically unusable on the Internet due to using obsolete standards.

Install the right OpenSSL version, and point the build to its location as per above if needed.

E.g.:

python-build: definition not found

To update your python-build definitions:

If you have python-build installed as an pyenv plugin:

$ cd ~/.pyenv/plugins/python-build && git pull
macOS: "ld: symbol(s) not found for architecture x86_64" (#1245)

From (#1245).

This may be caused by an incompatible version of ar bundled with brew-distributed binutils. This is the reason why binutils is keg-only.

To fix, uninstall binutils brew remove binutils, or remove them from PATH, or execute the install command with AR=/usr/bin/ar.

macOS: "ld: symbol(s) not found for architecture arm64"

This happens if:

Python cannot find a dependent dynamic library even though it's installed

If you're getting messages like this:

libreadline.so.7: cannot open shared object file: No such file or directory

or

ImportError: dlopen(/Users/durand/.pyenv/versions/3.10.1/lib/python3.10/site-packages/scipy/linalg/_fblas.cpython-310-darwin.so, 2): Library not loaded: /opt/homebrew/opt/gcc/lib/gcc/11/libgfortran.5.dylib
  Referenced from: /Users/durand/.pyenv/versions/3.10.1/lib/python3.10/site-packages/scipy/linalg/_fblas.cpython-310-darwin.so
  Reason: image not found

but you do have the corresponding package installed.

Check if the dynamic library's version you have installed is the same as what Python expects:

$ ls /lib/libreadline.so*
/lib/libreadline.so  /lib/libreadline.so.8  /lib/libreadline.so.8.0

Beside build time, this can also happen for an already installed version if:

"python-build: definition not found" or another new feature missing even though you have a new enough Pyenv

If your Pyenv is installed with Homebrew, check if you have a second, old Pyenv installed and earlier on PATH:

zsh % whence -a pyenv
pyenv
/Users/admin/.pyenv/bin/pyenv     <-- an extraneous Pyenv in /Users/admin/.pyenv
/usr/local/bin/pyenv

bash $ which -a pyenv
/Users/admin/.pyenv/bin/pyenv
/usr/local/bin/pyenv

If yes, remove it.

"configure: error: internal configure error for the platform triplet, please file a bug report" or "configure: error: Unexpected output of 'arch' on OSX" in MacOS
checking for the platform triplet based on compiler characteristics... darwin
configure: error: internal configure error for the platform triplet, please file a bug report

or (note that the architecture is detected as arm; see another case with the same error below if the architecture is incorrect)

checking build system type... arm-apple-darwin<...>
checking host system type... arm-apple-darwin<...>
<...>
configure: error: Unexpected output of 'arch' on OSX

This means that the Python version you're installing doesn't support your MacOS and/or XCode version. In particular:

Keg-only Homebrew packages are forcibly linked / added to PATH

Some keg-only (explanation is below) Homebrew packages are known to break Pyenv builds if forcibly linked/added to PATH. Unlink/Remove them from your PATH.

Known error messages they cause:

Some Homebrew packages are installed as "keg-only" -- i.e. their executables are not linked to $(brew --prefix)/bin. This is typically done because then they would override stock MacOS software (the specific reason is mentioned in brew info output), causing breakages. The same happens if you manually add them to PATH as specified in their brew info output.

On Apple Silicon, when building for ARM64, a dependency is present in x64 Homebrew but not ARM64 Homebrew

Known errors and their resolutions:

Since x64's Homebrew is in /usr/local, it's always in the compiler's search path. We however prepend /opt/homebrew to the compiler's search path when compiling for arm64 (actually, when brew on PATH is pointing there).

So if a library is installed and linked in the x64 Homebrew but not in Arm64 Homebrew, the compiler still finds it, even if it's compiling for arm64. However, linking with it fails as it's for the wrong architecture.

Tests Fail During PGO Compilation

If you're using ZFS, please refer to: https://github.com/python/cpython/issues/81765#issuecomment-2940741028

More info: https://github.com/pyenv/pyenv/issues/3267


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4