1
2
3
4
5
6
7
8
9
10
# 新建名为rosetta的虚拟环境,该环境中的Python架构为x86,经过转译运行
CONDA_SUBDIR=osx-64 conda create -n rosetta python
conda activate rosetta
python -c "import platform;print(platform.machine())" # 应输出“x86_64”
# make sure that conda commands in this environment use intel packages
conda env config vars set CONDA_SUBDIR=osx-64
conda deactivate # 需要reactivate该虚拟环境,以使设置生效
conda activate rosetta
echo "CONDA_SUBDIR: $CONDA_SUBDIR" # 应输出“CONDA_SUBDIR: osx-64”
conda install ... # 安装你想用的包