[英]Issues installing Python 3.8.10 on macOS 12.3 Monterey
Anyone having issues installing python 3.8.10 on macOS Monterey M1 Mac?有人在 macOS Monterey M1 Mac 上安装 python 3.8.10 时遇到问题吗? Any version I try to install using
pyenv install
gives me this error:我尝试使用
pyenv install
的任何版本都会给我这个错误:
python-build: use openssl@1.1 from homebrew python-build: use readline from homebrew Downloading Python-3.8.10.tar.xz... -> https://www.python.org/ftp/python/3.8.10/Python-3.8.10.tar.xz Installing Python-3.8.10... python-build: use readline from homebrew python-build: use zlib from xcode sdk
BUILD FAILED (OS X 12.3 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/yg/s2w3pfj172v6kdwx7hvmq65m0000gn/T/python-build.20220322155830.88129 Results logged to /var/folders/yg/s2w3pfj172v6kdwx7hvmq65m0000gn/T/python-build.20220322155830.88129.log
Last 10 log lines: checking for --with-cxx-main=<compiler>... no checking for clang++... no configure:
By default, distutils will build C++ extension modules with "clang++". If this is not intended, then set CXX on the configure command line.
checking for the platform triplet based on compiler characteristics... darwin configure: error: internal configure error for the platform triplet, please file a bug report make: *** No targets specified and no makefile found. Stop.
I've tried almost all questions across Google Search without success =(. I've tried to install using asdf python plugin and pyenv.
我在 Google 搜索中尝试了几乎所有问题,但都没有成功 =(。我尝试使用
asdf python plugin and pyenv.
Apple introduced a change that resulted in its breaking. Apple 引入了一项导致其崩溃的更改。
In your specific case pyenv install 3.8.13
should work.在您的特定情况下
pyenv install 3.8.13
应该可以工作。
For others on different versions should check this thread对于不同版本的其他人应该检查这个线程
Or use any of these versions 3.7.13, 3.8.13, 3.9.11 and 3.10.3或使用任何这些版本 3.7.13、3.8.13、3.9.11 和 3.10.3
brew install gcc && CC=`which gcc-11` pyenv install 3.8.10
It doesn't need to install gcc
with brew
!它不需要用
brew
安装gcc
! It might fall you in trouble much more!它可能会让你陷入更多麻烦!
There is a bundled gcc
in Apple Command Line Tools
which you can find it through below command: Apple Command Line Tools
中有一个捆绑的gcc
,您可以通过以下命令找到它:
which gcc
Be careful to don't add any version specific number to gcc
!注意不要在
gcc
中添加任何版本特定编号! something like gcc-11
or gcc-12
and so etc. Then check the found gcc
is located under /Library/Developer/CommandLineTools/
directory.像
gcc-11
或gcc-12
等等。然后检查找到的gcc
位于/Library/Developer/CommandLineTools/
目录下。 The desired output would be something like this:所需的 output 将是这样的:
$ which gcc
/Library/Developer/CommandLineTools/usr/bin/gcc
If everything is Ok, mean you run simple which gcc
command and it found gcc
and the found path is under /Library/Developer/CommandLineTools/
directory, you can install your python through pyenv
using following command:如果一切正常,意味着您运行简单
which gcc
命令并找到gcc
并且找到的路径位于/Library/Developer/CommandLineTools/
目录下,您可以使用以下命令安装pyenv
CC=`which gcc` pyenv install 3.8.6
you can install any version of python which is available and you need.您可以安装任何可用且您需要的 python 版本。
If you faced to any issue please comment it, it might help us to make answer more clear and helpful to you.如果您遇到任何问题,请发表评论,这可能有助于我们使答案更加清晰和对您有所帮助。
I faced the same issue.我遇到了同样的问题。 I realized my pyenv version was out of date.
我意识到我的 pyenv 版本已经过时了。 I updated it using homebrew by running:
我通过运行使用自制软件更新了它:
brew install pyenv
and then running然后运行
pyenv install 3.10.6
worked flawlessly.完美地工作。
Me help as:我帮助:
brew install gcc@11
after:后:
CC=`which gcc-11` pyenv install 3.8.12
I faced the same issue and the solution that worked for me was to install the version manually, here are the steps I performed to get it done:我遇到了同样的问题,对我有用的解决方案是手动安装版本,以下是我为完成它而执行的步骤:
/Applications/Python 3.8
/Applications/Python 3.8
Install Certificates.command
, wait until it completes.Install Certificates.command
,等待它完成。Update Shell Profile.command
Update Shell Profile.command
python3 --version
python3 --version
To setup a virtual environment for python version 3.8.10 installed manually:要为手动安装的 python 版本 3.8.10 设置虚拟环境:
pip install --upgrade pip
pip install virtualenv
cd my_project_folder/
virtualenv venv
source venv/bin/activate
deactivate
deactivate
You can get more information about setting up the virtual environment here: https://virtualenv.pypa.io/en/latest/user_guide.html#您可以在此处获取有关设置虚拟环境的更多信息: https://virtualenv.pypa.io/en/latest/user_guide.html#
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.