-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Description
Prerequisites
- Make sure your problem is not listed in the common build problems.
- Make sure no duplicated issue has already been reported in the pyenv issues. For build errors, a reported issue typically mentions a key error message. This key error message is often not in the 10 last build log lines reported to the console but is rather earlier in the build log -- typically, it's the first error message encountered in the log.
- Make sure you are reporting a problem in Pyenv and not seeking consultation with Pyenv usage.
- GitHub issues are intended mainly for Pyenv development purposes. If you are seeking help with Pyenv usage, check Pyenv documentation, go to a user community site like Gitter, StackOverflow, etc, or to Discussions.
- Make sure your problem is not derived from packaging (e.g. Homebrew).
- Please refer to the package documentation for the installation issues, etc.
- Make sure your problem is not derived from plugins.
- This repository is maintaining
pyenvand the defaultpython-buildplugin only. Please refrain from reporting issues of other plugins here.
- This repository is maintaining
Describe the bug
Python2 installs fail with a range of errors such as `BUILD FAILED (Fedora Linux 42 using python-build 2.6.7)
Inspect or clean up the working tree at /tmp/python-build.20250926013054.475715
Results logged to /tmp/python-build.20250926013054.475715.log
Last 10 log lines:
9 | typedef enum {false, true} bool;
| ^~~~~
Include/asdl.h:9:15: note: ‘false’ is a keyword with ‘-std=c23’ onwards
Include/asdl.h:9:28: error: expected ‘;’, identifier or ‘(’ before ‘bool’
9 | typedef enum {false, true} bool;
| ^~~~
Include/asdl.h:9:28: warning: useless type name in empty declaration
make: *** [Makefile:1250: Python/asdl.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [Makefile:1250: Python/Python-ast.o] Error 1
`
and
`BUILD FAILED (Fedora Linux 42 using python-build 2.6.7)
Inspect or clean up the working tree at /tmp/python-build.20250926012751.464779
Results logged to /tmp/python-build.20250926012751.464779.log
Last 10 log lines:
Python/ast.c:2631:17: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
2631 | if (!import_alias)
| ^~
Include/asdl.h:42:31: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
42 | #define asdl_seq_SET(S, I, V) (S)->elements[I] = (V)
| ^
Python/ast.c:2633:21: note: in expansion of macro ‘asdl_seq_SET’
2633 | asdl_seq_SET(aliases, i / 2, import_alias);
| ^~~~~~~~~~~~
make: *** [Makefile:1382: Python/ast.o] Error 1
`
Reproduction steps
pyenv install 2.7.18 and pyenv install 2.7.6. All python2 versions fail with any number of errors even on a brand new install.
Diagnostic details
- [Fedora 42 ] Platform information (e.g. Ubuntu Linux 24.04):
- [amd64 ] OS architecture (e.g. amd64):
- [2.6.7 ] pyenv version:
- [ 3.13.7] Python version:
- [ GCC 15.2.1] C Compiler information (e.g. gcc 7.3):
- Please attach the debug trace of the failing command as a gist:
- Run
env PYENV_DEBUG=1 <faulty command> 2>&1 | tee trace.logand attachtrace.log. E.g. if you have a problem with installing Python, runenv PYENV_DEBUG=1 pyenv install -v <version> 2>&1 | tee trace.log(note the-voption topyenv install).
- Run
- If you have a problem with installing Python, please also attach
config.logfrom the build directory- The build directory is reported after the "BUILD FAILED" message and is usually under
/tmp.
- The build directory is reported after the "BUILD FAILED" message and is usually under
- If the build succeeds but the problem is still with the build process (e.g. the resulting Python is missing a feature), please attach
- the debug trace from reinstalling the faulty version with
env PYENV_DEBUG=1 pyenv install -f -k -v <version> 2>&1 | tee trace.log config.logfrom the build directory. When usingpyenv installwith-kas per above, the build directory will be under$PYENV_ROOT/sources.
- the debug trace from reinstalling the faulty version with
- If the problem happens in another Pyenv invocation, turn on debug logging by setting
PYENV_DEBUG=1, e.g.env PYENV_DEBUG=1 pyenv local 3.6.4, and attach the resulting trace as a gist - If the problem happens outside of a Pyenv invocation, get the debug trace like this:
export PYENV_DEBUG=1 # for Bash export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }' # for Zsh export PS4='+(%x:%I): %N(%i): ' set -x <reproduce the problem> set +x