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

Has*_*tur 3 python windows compilation mingw-w64

我想在Win10上编译一个fortran文件,就像 python3 -m numpy.f2py -c -m h3plus h3plus.f90
但是MSYS2中的python不包含NumPy,所以我尝试使用conda,但我不知道如何在MSYS2上使用conda。

nom*_*s10 6

如果您的 Windows 计算机上尚未安装 anaconda/miniconda,请下载正确的 Windows 安装程序。

如果windows端已经安装了conda,那么你所要做的就是为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 <<<
Run Code Online (Sandbox Code Playgroud)

conda.exe确保将第三行的路径替换为您计算机上的路径。之后关闭并重新打开 MSYS2 终端。

如果您使用的是 bash 以外的 shell,则可以检查 的输出conda init --all --dry-run --verbose以查找相应的初始化脚本。