Anyone having issues installing python 3.8.10 on macOS Monterey M1 Mac? Any version I try to install using pyenv install
gives me this error:
python-build: use [email protected] 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.
CodePudding user response:
This worked for me.
Install gcc first;
brew install gcc
And then with gcc run pyenv installation.
CC=/opt/homebrew/bin/gcc-11 pyenv install 3.8.10
CodePudding user response:
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:
- Download the python-3.8.10 version here: https://www.python.org/downloads/release/python-3810/
- Once downloaded, double-click to install through the installation wizard.
- Once completed, from finder or terminal open the directory where it got installed:
/Applications/Python 3.8
- Run the
Install Certificates.command
, wait until it completes. - In the same path, run
Update Shell Profile.command
- You are all set, to validate it run from the terminal:
python3 --version
To setup a virtual environment for python version 3.8.10 installed manually:
pip install --upgrade pip
pip install virtualenv
cd my_project_folder/
virtualenv venv
source venv/bin/activate
- To deactivate once finish working, run:
deactivate
You can get more information about setting up the virtual environment here: https://virtualenv.pypa.io/en/latest/user_guide.html#