安装python3.8
brew install python@3.8
安装完成之后,找到对应路径(如果需要修改默认python3的话,做下软连接就是)
/opt/homebrew/Cellar/python@3.8/3.8.9/bin/python3.8
/opt/homebrew/Cellar/python@3.8/3.8.9/bin/pip3.8
安装virtualenv:
./pip3.8 install virtualenv -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
如果不知道pip安装的包安装到哪个路径了,可以用 ./python3.8 -m site 查看下
然后创建你需要的python3.8环境
virtualenv 虚拟环境名称 -p 所依赖的的python
virtualenv DV3AVENV -p /opt/homebrew/Cellar/python@3.8/3.8.9/bin/python3.8