How to install multiple Python versions on Mac M1

Viewed 7333

I already installed Python 3.9.2 as it supports ARM64 as recommended in Python.org

I created a virtual environment after that using python3 -m venv py39

Now I need to have another environment but with Python 3.8.8 as Tensorflow is supporting 3.8 only. How could I create another virtual environment with Python 3.8 while maintaining the other 3.9 env. In case of asking me to use conda, Does conda support Mac M1 ARM64 as it doesn't according to my search

I found same question asked many times but for windows and answers are very old like: Use different Python version with virtualenv 11 Years ago

2 Answers

Is there a reason you're tied to conda?

The reason I ask is there are easier routes to getting isolated Python environments, which might have moved a bit faster on the needed M1 migrations.

I recommend at least checking out

If you are tied to conda, it seems like there are some related posts: How can I run Python 3.9.1 natively on M1 Mac?

I found out, with pyenv and miniforge it is no problem to work with conda, even with older versions like 3.8, which seemed to be a constrained on M1. With

brew update
brew install pyenv
pyenv install miniforge3-4.10
pyenv global miniforge3-4.10
conda create -n new_env python=3.8
conda activate new_env
conda install poetry
poetry new project
cd project
poetry add open3d

With this you can install any package and can use conda in every way you want, as far as I tested it. Instead of peotry you can of course use conda install {package} in the usual way.

Related