Can't Install Python 3.10.0 With Pyenv On MacOS
Solution 1:
The problem was that I had a second version of clang installed (via homebrew), which interfered with the build. After running brew uninstall llvm
pyenv/python-build picked the clang from xcode and now pyenv works again.
Solution 2:
Try env ARCHFLAGS="-arch x86_64"
(that works for me for other Python-related tools, I don't use pyenv myself).
Rationale: modern macOS supports 2 architectures: intel (x86_64) and m1 (arm-something). Compiling for only one architecture is easier.
Solution 3:
Sorry, still no idea why, but I just tried and it's working for me (terminal output below). I'm running Mac OS Big Sur, version 11.5.2 with an Intel i7 processor. My pyenv version is also the latest (2.1.0)
$ pyenv install 3.10.0
python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-3.10.0.tar.xz...
-> https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tar.xz
Installing Python-3.10.0...
python-build: use tcl-tk from homebrew
python-build: use readline from homebrew
python-build: use zlib from xcode sdk
Installed Python-3.10.0 to /Users/myuser/.pyenv/versions/3.10.0
Before this I did:
brew update && brew upgrade pyenv
Solution 4:
I had a similar issue, which was resolved by setting the $CC
environment variable to clang
.
Solution 5:
Try this:
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
It worked for me!
Reference: https://stackoverflow.com/a/66522514/6319240
Post a Comment for "Can't Install Python 3.10.0 With Pyenv On MacOS"