I had to do a few tricky work-arounds to build a Fortran extension under Python 3.6 this week. We're running Windows 7 and we installed from Anaconda 4.3.1 (64-bit). Our extension module is build by f2py via numpy.distutils, and it requires that we conda install mingw libpython.
When we ran
python setup.py install, the first error was "
ValueError:
Unknown MS Compiler version 1900." The solution was to manually comment out a few lines in the distutils and numpy.distutils code as described by Michael Hirsch.
The next error was
...
running build_py
running build_ext
Looking for python36.dll
Building import library (arch=AMD64):
"c:\ProgramData\Anaconda3\libs\libpython36.a" (from c:\ProgramData\Anaconda3\python36.dll)
error: [WinError 2] The system cannot find the file
specified
The solution was to copy the file c:\ProgramData\Anaconda3\libs\libpython36.dll.a to ...\libpython.a. Renaming the file probably would have worked too.
Finally, our module failed to load because the compiled extension was named _mymodule.cp36-win_amd64.pyd instead of _mymodule.pyd. After renaming the file everything ran splendidly and we're back to doing science.
Andrew Hawryluk