Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I have installed MSYS2 and Anaconda3, then how can I use conda on MSYS2?

I want to complie a fortran file on Win10, just like python3 -m numpy.f2py -c -m h3plus h3plus.f90
But python in MSYS2 doesn't contain NumPy, so I try to use conda, but I don't know how to use conda on MSYS2.

like image 393
Hastur Avatar asked Oct 29 '25 20:10

Hastur


1 Answers

If you don't have anaconda/miniconda already installed on your windows machine, do that by downloading the proper windows installer.

If conda is already installed on the windows side, all you have to do is initialize conda for MSYS2's bash. To do this, edit .bash_profile and append something like the following:

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

Make sure you replace the path on the 3rd line with the path to conda.exe on your machine. After that close and reopen your MSYS2 terminals.

If you're using a shell other than bash, you can inspect the output of conda init --all --dry-run --verbose in order to find the corresponding init script.

like image 87
nomius10 Avatar answered Nov 01 '25 10:11

nomius10



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!