Configuring MSYS2 with Numpy

Hate to admit it but I’ve never really set up a working Python environment and depend upon the LE or online sandbox for working modules. Still very much a newbie in that regard.

Does anybody use MSYS2?

I have this page open and ready,

The thing is it is a TAR file. Where would a person download this file to? A folder in MSYS2? Can the package manager extract the contents for installation?

$ pacman -Syu mingw-w64-x86_64-python3-numpy

You can leave out yu to only install that package, but with yu you are also updating your package index and updating everything else.

$ pacman -S --help

You can also install it using pip

$ python3 -m pip install --user numpy

which might or might not require a C compiler (and who knows maybe fortran n stuff) and possibly other build tools

Dumb question,

error: target not found: mingw-w64-x86_64-python3-numpy

Where is it looking for this file? The download location? What about the extraction? I don’t have anything to extract a TAR file.

You do, but there’s more to it than that, and it’s pacman’s job

Search first, with $ pacman -Ss numpy

And you may need to do just

$ pacman -Syu

If you did not do so during installation (was part of the instructions)
(which you should do anyway if you haven’t in a while, to keep your system (the part that is msys anyway) up to date)

did that go through? should look like this:

Once I shut down the shell and opened it again, the update went through to completion and the bash prompt is back. Going to see if I can import numpy…

>>> from numpy import *
ModuleNotFoundError: No module named 'numpy'

so… you never asked pacman to install numpy?

Not specifically, no. Will try that line again…

$ pacman -Syu mingw-w64-x86_64-python3-numpy

don’t need yu options any more, you already did those things

$ pacman -S --help
  -u, --sysupgrade     upgrade installed packages (-uu enables downgrades)
  -y, --refresh        download fresh package databases from the server

doesn’t make a difference, but you should only be entering things you mean to do, and you don’t mean to do that again

Kind of thought so, so just used,

$ pacman -S mingw-w64-x86_64-python3-numpy

It’s installing now.

Got the prompt, so trying again…

Still no module found for,

from numpy import *

The installation was 29 files, and finished with this line…

(29/29) installing mingw-w64-x86_64-python-numpy          ... 100%
Optional dependencies for mingw-w64-x86_64-python-numpy
    mingw-w64-x86_64-python-pytest: testsuite

Does that mean something is missing?


$ pacman -Ss numexpr
mingw32/mingw-w64-i686-python-numexpr 2.7.0-1
    Fast numerical array expression evaluator for Python, NumPy, PyTables,
    pandas (mingw-w64)
mingw64/mingw-w64-x86_64-python-numexpr 2.7.0-1
    Fast numerical array expression evaluator for Python, NumPy, PyTables,
    pandas (mingw-w64)


It doesn’t have [installed] showing, so does that mean this module is not installed?

What’s numexpr got to do with anything?
Do you want to use the feature that the optional dependency is needed for?
Why is your python version reported as 3.7 when the one in the package list is 3.8?

python --version
python3 --version
python3.8 --version
which python3
/usr/bin/python3 --version
python3 -c 'import sys; print(sys.executable)'

No idea. Try the update again?

No, run the commands and show me the outputs (just paste them in), find out why your python3 name is pointing at the wrong thing

and also

$ echo $PATH


$ echo $PATH

This isn’t windows, you don’t press UPDATE and hope.
Pop the hood up, find out what’s up.

1 Like

Were you asked by pacman if you were to replace the python3 package?
If so, you should have said yes.

$ pacman -Qo /usr/bin/python3.exe

The only prompt I ever responded to was to go ahead with installation [Y/n].

$ pacman -Qo /usr/bin/python3.exe
/usr/bin/python3.exe is owned by python 3.7.4-1

Right, so, you have a package named python.
just that.
your numpy package depends on this package:

installing numpy presumably should have required installing mingw-w64-x86_64-python as well, and presumably that should have conflicted with your “python” package

What is going on there? Don’t know. Don’t use msys.

pacman -R python

this might fail, but if so, what does it say?

and what does pacman -S mingw-w64-x86_64-python