Skip to content

Cannot install any python2 versions at all on fedora 42 #3335

@j3r1ch0

Description

@j3r1ch0

trace.log

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.
  • 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 pyenv and the default python-build plugin only. Please refrain from reporting issues of other plugins here.

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.log and attach trace.log. E.g. if you have a problem with installing Python, run env PYENV_DEBUG=1 pyenv install -v <version> 2>&1 | tee trace.log (note the -v option to pyenv install).
  • If you have a problem with installing Python, please also attach config.log from the build directory
    • The build directory is reported after the "BUILD FAILED" message and is usually under /tmp.
  • 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.log from the build directory. When using pyenv install with -k as per above, the build directory will be under $PYENV_ROOT/sources.
  • 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
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions