pyenv / pyenv

Simple Python version management

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adapt to executable naming in the free-threaded build

ngoldbaum opened this issue · comments

Prerequisite

  • 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. You should look for closed issues, too.
  • Make sure you are not asking us to help solving your specific issue.
    • GitHub issues is opened mainly for development purposes. If you want to ask someone to help solving your problem, go to some community site like Gitter, StackOverflow, etc.
  • 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.

Description

  • Platform information (e.g. Ubuntu Linux 16.04): MacOS Sonoma
  • OS architecture (e.g. amd64): aarch64
  • pyenv version: 2.3.36
  • Python version: 3.13.0b1
  • C Compiler information (e.g. gcc 7.3): Apple clang version 15.0.0 (clang-1500.1.0.2.5)
  • 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.

This used to work (#2851) but seems to have broken recently.

CONFIGURE_OPTS=--disable-gil pyenv install -f -v 3.13-dev

Lots of output, that ends with:

Successfully installed pip-24.0
ERROR: invalid Python executable: /Users/goldbaum/.pyenv/versions/3.13-nogil/bin/python3.13

The python-build could not find proper executable of Python after successful build.
Please open an issue for future improvements.
https://github.com/pyenv/pyenv/issues

BUILD FAILED (OS X 14.2.1 using python-build 20180424)

trace.log: https://gist.github.com/ngoldbaum/ed263d2bf0e30f31b573a1d7cfa04c5b
config.log: https://gist.github.com/ngoldbaum/ff670ca701780008ebd46598bee9e728

As a workaround, you can use a custom build definition that removes the verify_py313 step from the 3.13-dev or 3.13.0b1 definitions:

prefer_openssl3
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
export PYTHON_BUILD_TCLTK_USE_PKGCONFIG=1
export PYTHON_BUILD_CONFIGURE_WITH_DSYMUTIL=1
install_package "openssl-3.3.0" "https://www.openssl.org/source/openssl-3.3.0.tar.gz#53e66b043322a606abf0087e7699a0e033a37fa13feb9742df35c3a33b18fb02" mac_openssl --if has_broken_mac_openssl
install_package "readline-8.0" "https://ftpmirror.gnu.org/readline/readline-8.0.tar.gz#e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461" mac_readline --if has_broken_mac_readline
install_git "Python-3.13-dev" "https://github.com/python/cpython" 3.13 standard copy_python_gdb ensurepip

If I had to guess, this is because they added a python3.13t executable to the build:

○  ls -lh /Users/goldbaum/.pyenv/versions/3.13-dev/bin/
total 328
lrwxr-xr-x@ 1 goldbaum  staff     8B May 17 09:52 idle -> idle3.13
lrwxr-xr-x@ 1 goldbaum  staff     8B May 17 09:52 idle3 -> idle3.13
-rwxr-xr-x@ 1 goldbaum  staff   131B May 17 09:52 idle3.13
lrwxr-xr-x@ 1 goldbaum  staff     7B May 17 09:52 pip -> pip3.13
-rwxr-xr-x@ 1 goldbaum  staff   260B May 17 09:52 pip3
-rwxr-xr-x@ 1 goldbaum  staff   260B May 17 09:52 pip3.13
lrwxr-xr-x@ 1 goldbaum  staff     9B May 17 09:52 pydoc -> pydoc3.13
lrwxr-xr-x@ 1 goldbaum  staff     9B May 17 09:52 pydoc3 -> pydoc3.13
-rwxr-xr-x@ 1 goldbaum  staff   116B May 17 09:52 pydoc3.13
lrwxr-xr-x@ 1 goldbaum  staff    10B May 17 09:52 python -> python3.13
lrwxr-xr-x@ 1 goldbaum  staff    17B May 17 09:52 python-config -> python3.13-config
lrwxr-xr-x@ 1 goldbaum  staff    10B May 17 09:52 python3 -> python3.13
lrwxr-xr-x@ 1 goldbaum  staff    17B May 17 09:52 python3-config -> python3.13-config
-rwxr-xr-x@ 2 goldbaum  staff    33K May 17 09:51 python3.13
lrwxr-xr-x@ 1 goldbaum  staff    18B May 17 09:52 python3.13-config -> python3.13t-config
-rwxr-xr-x@ 1 goldbaum  staff    69K May 17 09:52 python3.13-gdb.py
-rwxr-xr-x@ 2 goldbaum  staff    33K May 17 09:51 python3.13t
-rwxr-xr-x@ 1 goldbaum  staff   2.1K May 17 09:52 python3.13t-config
drwxr-xr-x@ 3 goldbaum  staff    96B May 17 09:51 python3.13t.dSYM
++(/opt/homebrew/Cellar/pyenv/2.3.36/plugins/python-build/bin/python-build:579): fetch_git(): git clone --depth 1 --branch main https://github.com/python/cpython Python-3.13-dev

Upgrade Pyenv to the latest release which has #2960

Thanks for diagnosing! I switched to using pyenv from a clone of the repo so I can update faster.