Python 3.4: compile cython module for 64-bit windows

I have a .pyx module that I tried to compile for use with 64-bit python 3.4 on Windows using various tools, but without success.

After a lot of trial and error, it compiles with

python setup.py build_ext --inplace --compiler=mingw32 

but of course this will not work with 64bit python.

With msvc as a compiler error

 File "C:\Python34\lib\distutils\msvc9compiler.py", line 287, in query_vcvarsall raise ValueError(str(list(result.keys()))) ValueError: ['path'] 
  • Windows 7
  • Installed Microsoft Windows SDK for Windows 7 and .NET Framework 4.
  • Microsoft C: \ Program Files (x86) (including vcvarsall.bat) has some Microsoft Visual Studio 10.0 content

Solutions that do not revolve around distutils are also welcome.

--- EDIT: More Information

Now I modified distutils to recognize mingw-w64 at http://bugs.python.org/issue11723 . Then I did libpython34.a using gendef and dlltool, but I get an error

 c:\Python34\libs/libpython34.a: file not recongnized: File truncated 

at startup

 python setup.py build_ext --inplace --compiler=mingw64 
+5
source share
1 answer

Well, finally I managed to get it to work.

The key are the fantastic resources of Christoph Golke ( http://www.lfd.uci.edu/~gohlke/pythonlibs ).

(Having tried all kinds of wild sentences for this task, I went a lot more steps, but as far as I can tell, these are the only ones that actually made a difference at the end)

+4
source

Source: https://habr.com/ru/post/1209123/


All Articles