I am trying to run some code with Python 3.5 on Windows 10 with the use of cygwin (mingw). To be precise I am using the PyDSTool module, where I call the dopri integrator. T
If anyone still has this problem,i just ran into it while installing yowsup and python-axolotl, this is what i did to solve it:
1- Apply the patch from Tharen into the python cygwinccompiler.py file (located in your python installation folder) https://bugs.python.org/file40608/patch.diff
2-With mingw, install pexports, open a terminal in administrator mode and type:
mingw-get install pexports
2-Go to the python install folder, in my case it was C:\Program Files (x86)\Python36-32
still in the same terminal we used to install pexports, after navigating to the python install folder run the following:
pexports vcruntime140.dll >libs\vcruntime140.def
dlltool -dllname vcruntime140.dll --def libs\vcruntime140.def --output-lib libs\libvcruntime140.a
Then go back to the folder where you were installing the library, or whatever you were doing before, it should work now.
btw, dont forget to add
[build]
compiler = mingw32
in the distutils file.
Source: this own post and https://bugs.python.org/issue25251
I was running on the same problem and figured out that the issue was with the mingw compiler. I tried the patches suggested by @tharen but it didn't work for me.
It seems that cygwin's favourite compiler for windows is the visual c++ so I downloaded just the visual c++ build tools from http://landinghub.visualstudio.com/visual-cpp-build-tools and then it worked fine.
Note that you will need to uninstall mingw and all references to it that you included in your project. In particular I had to delete a distutils.cfg file that I had created which had the following code pointing to mingw
[build]
compiler = mingw32
Details in link helped me resolve this like a charm.
Just commented get_msvcr()
in cygwinccompiler.py.
(remember to comment the else
also)
Distutils and Numpy/Distutils currently do not have support for Visual Studio 2015, Visual C++ 14. Following tips drawn from the Python bug report, I was able to patch the necessary files and successfully build extension using a new install of Python 3.5 from Anaconda and Mingw64 with GCC 5.2.0 running within MSYS2 on Windows 7. I do not have Visual Studio installed. The solution was to patch one distutils file and two numpy/distutils files (if this applies). These patches have been submitted for inclusion in future revisions.
You can apply the patches yourself for a quick fix:
UPDATE
Please note that while the patches above worked for me it was not accepted for inclusion in upstream. The changes that came with VS 2015 are more complex than I appreciated.
I made the following changes and it worked for me with the following configurations.
I did the following
C:\mingw-w64\x86_64-7.1.0-posix-seh-rt_v5-rev0\mingw64\bin
for me)gcc
works ( I have no other compilers)distutils.cfg
in C:\Python36\Lib\distutils
Add lines in that file:
[build]
compiler = mingw32
Manually applying this patch
vcruntime140.dll
and putting it in C:\Python36\libs
I just made he following changes and it worked like a charm!
Edit file distutils.cfg present in locations:
Modify content of distutils.cfg to :
[build]
compiler=g++
[build_ext]
compiler=g++
P.S. Probably changing only in 2nd location should also do.
P.P.S Make sure gcc is installed and is in PATH. For me , TDM-GCC-64 was installed