python - How to get cython to use MinGW with enthought canopy distribution -
i downloaded enthought's canopy academic version , installed cython , mingw (along lot of other packages) , want utilize cython code in ipython notebook via cell magic %%cython had written previously. using windows 7 64-bit.
except this:
distutilsplatformerror: not find visual studio 2008 in path. if not have visual studio 2008 installed, can utilize mingw compiler instead. install mingw, do: enpkg mingw utilize mingw compiler build extension module, utilize '-c' flag, e.g.: python setup.py build_ext -c mingw64 note building python extensions mingw not officially supported, although known work in many cases. this mentioned right in cython docs happen if mingw not added path. sense much easier anaconda here's i've done far:
i've tried adding these path:
c:\users\patrick\user\egg-info\mingw\usr\x86_64-w64-mingw32\bin
c:\users\patrick\user\egg-info\mingw\usr\bin
c:\users\patrick\user\lib\site-packages\mingw-4.8.1-2.egg-info\scripts
what have cython utilize mingw epd?
i using academic version of enthought canopy , had same issue you.
i solved setting vs90comntools in scheme environnement variable c:/program files (x86)/microsoft visual studio 12.0/common7/tools (i using vs2013 pro in windows 8.1 x64)
i have added path vcvarsall.bat whch in case is: c:\program files (x86)\microsoft visual studio 12.0\vc scheme environnement variables
run vcvarsall.bat in command prompt, python setup.py build_ext --inplace , should work
edit:
i have tested , worked:
in [1] : %load_ext cythonmagic in [2] : %%cython def fib(int n): cdef int i, a, b a, b = 1, 1 in range(n): a, b = a+b, homecoming in [3] : fib(10) out[3] : 144 python mingw cython enthought
No comments:
Post a Comment