我已经安装了MSYS2和Anaconda3,那么我该如何在MSYS2上使用conda?

3

我想在Win10上编译一个Fortran文件,就像这样

python3 -m numpy.f2py -c -m h3plus h3plus.f90

但是MSYS2中的Python没有NumPy,所以我尝试使用conda,但我不知道如何在MSYS2上使用conda。

1个回答

6

如果您的Windows计算机上没有安装Anaconda/Miniconda,请通过下载适当的Windows安装程序进行安装。

如果conda已经安装在Windows端,您只需为MSYS2的bash初始化conda。要做到这一点,编辑.bash_profile并追加以下内容:

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
eval "$('/c/Users/John/miniconda3/Scripts/conda.exe' 'shell.bash' 'hook')"
# <<< conda initialize <<<

请确认在第三行将路径替换为您机器上 conda.exe 的路径。然后关闭并重新打开您的 MSYS2 终端。
如果您使用的不是 bash shell,则可以检查 conda init --all --dry-run --verbose 的输出以找到对应的初始化脚本。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接