question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Installation fails in current MSYS2

See original GitHub issue

I 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:closed
  • Created 7 years ago
  • Comments:32 (18 by maintainers)

github_iconTop GitHub Comments

1reaction
rolkcommented, Feb 9, 2017

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 named setup.cfg in the same directory as setup.py:

[build]
compiler=mingw32

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.

0reactions
mattipcommented, Nov 11, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MSYS2-installer failed on Windows 10 64-bit #1896 - GitHub
I got the same error with msys2-x86_64-20210105.exe. It was caused by my existing ~/.bash_profile, which is not under /msys64 so was not deleted ......
Read more >
MSYS2-Installation
Simply make a list of the packages that failed to install correctly, exit all your MSYS2 shells (make sure that they fully exit...
Read more >
How can I resolve this installation error of Msys2
I downloaded the Msys2 32bit installer and wanted to set up everything as described here: https://www.msys2.org/.
Read more >
installation script breaks on msys2 installation (#344) · Issues
When I first tried to install with GHCup, the default path was "C:" and then I changed each entry to "C:\Program Files" When...
Read more >
bug#45612: Error installing on Windows / MSYS2
bug#45612: Error installing on Windows / MSYS2 ... will be installed before its mingw-w64-x86_64-freetype dependency
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found