geoffr
(Geoff)
November 1, 2024, 12:40pm
1
I am trying to install a universal version of python using pyenv. I have tried the following, but it is missing SSL for some reason
env PYTHON_CONFIGURE_OPTS="--enable-shared --enable-universalsdk --with-universal-archs=universal2" pyenv install 3.10.4
file /Users/geoffroddick/.pyenv/versions/3.10.4/bin/python3.10
/Users/geoffroddick/.pyenv/versions/3.10.4/bin/python3.10: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64:Mach-O 64-bit executable arm64]
/Users/geoffroddick/.pyenv/versions/3.10.4/bin/python3.10 (for architecture x86_64): Mach-O 64-bit executable x86_64
/Users/geoffroddick/.pyenv/versions/3.10.4/bin/python3.10 (for architecture arm64): Mach-O 64-bit executable arm64
Running “python -m pip install update pip” fails and I don’t know why, nor how to fix - any suggestions?
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/update/
It looks like there are known issues with PyEnv and SSL on MacOS. Have you tried the suggested workarounds, e.g. for this one:
opened 06:03PM - 02 Oct 23 UTC
closed 01:14PM - 08 Apr 24 UTC
wontfix
os: macOS
area: build
need-feedback
```
❯ env CONFIGURE_OPTS='--enable-optimizations' pyenv install 3.12.0
python-… build: use openssl@3 from homebrew
python-build: use readline from homebrew
Downloading Python-3.12.0.tar.xz...
-> https://www.python.org/ftp/python/3.12.0/Python-3.12.0.tar.xz
Installing Python-3.12.0...
python-build: use tcl-tk from homebrew
python-build: use readline from homebrew
python-build: use zlib from xcode sdk
BUILD FAILED (OS X 13.6 using python-build 2.3.28)
Inspect or clean up the working tree at /var/folders/v0/l8q3ghks2gs5ns2_p63tyqh40000gq/T/python-build.20231002105901.37245
Results logged to /var/folders/v0/l8q3ghks2gs5ns2_p63tyqh40000gq/T/python-build.20231002105901.37245.log
Last 10 log lines:
/opt/homebrew/opt/coreutils/libexec/gnubin/install -c -m 755 Modules/termios.cpython-312-darwin.so /Users/bgabor8/.pyenv/versions/3.12.0/lib/python3.12/lib-dynload/termios.cpython-312-darwin.so
/opt/homebrew/opt/coreutils/libexec/gnubin/install -c -m 755 Modules/_posixshmem.cpython-312-darwin.so /Users/bgabor8/.pyenv/versions/3.12.0/lib/python3.12/lib-dynload/_posixshmem.cpython-312-darwin.so
/opt/homebrew/opt/coreutils/libexec/gnubin/install -c -m 755 Modules/_multiprocessing.cpython-312-darwin.so /Users/bgabor8/.pyenv/versions/3.12.0/lib/python3.12/lib-dynload/_multiprocessing.cpython-312-darwin.so
/opt/homebrew/opt/coreutils/libexec/gnubin/install -c -m 755 Modules/_ctypes.cpython-312-darwin.so /Users/bgabor8/.pyenv/versions/3.12.0/lib/python3.12/lib-dynload/_ctypes.cpython-312-darwin.so
/opt/homebrew/opt/coreutils/libexec/gnubin/install -c -m 755 Modules/_curses.cpython-312-darwin.so /Users/bgabor8/.pyenv/versions/3.12.0/lib/python3.12/lib-dynload/_curses.cpython-312-darwin.so
/opt/homebrew/opt/coreutils/libexec/gnubin/install -c -m 755 Modules/_curses_panel.cpython-312-darwin.so /Users/bgabor8/.pyenv/versions/3.12.0/lib/python3.12/lib-dynload/_curses_panel.cpython-312-darwin.so
/opt/homebrew/opt/coreutils/libexec/gnubin/install -c -m 755 Modules/_sqlite3.cpython-312-darwin.so /Users/bgabor8/.pyenv/versions/3.12.0/lib/python3.12/lib-dynload/_sqlite3.cpython-312-darwin.so
/opt/homebrew/opt/coreutils/libexec/gnubin/install -c -m 755 Modules/_ssl.cpython-312-darwin.so /Users/bgabor8/.pyenv/versions/3.12.0/lib/python3.12/lib-dynload/_ssl.cpython-312-darwin.so
install: cannot stat 'Modules/_ssl.cpython-312-darwin.so': No such file or directory
```
On 3.11 M1 macbook.
UPDATE: https://github.com/pyenv/pyenv/issues/2805#issuecomment-1744491474
geoffr
(Geoff)
November 1, 2024, 6:19pm
3
Still get the same error
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/update/
geoffr
(Geoff)
November 4, 2024, 1:13pm
4
I found a solution that works here:
opened 08:15PM - 28 Feb 22 UTC
closed 05:13PM - 18 Mar 22 UTC
third-party
When executing `PYTHON_CONFIGURE_OPTS="--enable-universal-archs" pyenv install 3… .9.9` on a macOS intel machine, it doesn't install the universal2 python, because `file /Users/$USER/.pyenv/versions/3.9.9/bin/python3` shows only x86_64. However, it is possible to install [universal2 python](https://www.python.org/ftp/python/3.9.10/python-3.9.10-macos11.pkg) via https://www.python.org/downloads/macos/ on a macOS intel machine.
After investigating https://github.com/pyenv/pyenv/blob/master/plugins/python-build/bin/python-build#L2137, I realized universal2 python is only limited to Apple Silicon machines, and I am not sure why. Can we enable universal2 python on macOS intel machines as well?