Installation fails in current MSYS2
See original GitHub issueI am using MSYS2 in Windows 10. With MINGW64 shell, Python and pip is available as MSYS2 packages mingw-w64-x86_64-python3
(Python 3.5.2), mingw-w64-x86_64-python3-pip
(pip 8.1.2 / manually upgraded to pip 9.0.1) and dependencies installed.
When I try to install numpy via pip, it ends with a failure stack trace ending
ValueError: python35.dll not found in ['E:/mingw64', 'E:/mingw64/lib', 'C:\\WINDOWS/system32']
saying python35.dll should be found in some location. The DLL filename spec is designated in some places:
numpy/distutils/mingw32ccompiler.py:240:
dllname = 'python%d%d.dll' % (maj, min)
numpy/distutils/mingw32ccompiler.py:428:
dll_name = "python%d%d.dll" % tuple(sys.version_info[:2])
In MSYS2, however, Python 3.5 DLL follows libpython<version>m.dll
.
$ pacman -Ql mingw-w64-x86_64-python3 | grep dll
mingw-w64-x86_64-python3 /mingw64/bin/libpython3.5m.dll
mingw-w64-x86_64-python3 /mingw64/lib/libpython3.5.dll.a
mingw-w64-x86_64-python3 /mingw64/lib/libpython3.5m.dll.a
mingw-w64-x86_64-python3 /mingw64/lib/python3.5/config-3.5m/libpython3.5.dll.a
mingw-w64-x86_64-python3 /mingw64/lib/python3.5/config-3.5m/libpython3.5m.dll.a
...
The code snippets requiring python<version>.dll
is 8~11 years old (known from git blame) and still alive.
Maybe I can write a patch for this, but I don’t know any specific DLL path for MinGW, MSYS or Anaconda installation. As I know, previous MinGW/MSYS environment requires Python to be installed separately by the official installer, instead of being installed via pacman. I am slightly afraid that my patch can break any compatibility. Also, I don’t know the overall structure of NumPy distutils functionality. What is the appropriate thing I can do? If possible, where is the point I can write a patch on?
Issue Analytics
- State:
- Created 7 years ago
- Comments:32 (18 by maintainers)
Top GitHub Comments
This is like in one of the old Indiana Jones movies, where when the hero has passed one trap, he just finds out that there are more traps!
It seems at first glance that it doesn’t find your Fortran compiler, but instead wants to try to use the Intel compiler. Can you run
gfortran
in this environment? Try to force it to select the GNU compiler by putting these lines in a file namedsetup.cfg
in the same directory as setup.py:I am a little confused, though. The signature of the MSVCCompiler.initialize method in the distutils.msvccompiler module has taken no extra arguments since forever: https://github.com/python/cpython/blob/master/Lib/distutils/msvccompiler.py#L248
The MSVCCompiler.initialize method in the distutils.msvc9compiler compiler module however, take a plat_name argument. Could it be that testing always pick this variant? (except when run under MSYS!) Paging @dzagorny for input.
This issue is closed. If you want to pursue building numpy with mingw64 (probably a difficult task), please open a new one. Describe exactly what you installed, and the error message you got. You may have some luck by setting CC to your compiler path.