我正在嘗試關注此basic cython tutorial。在我的目錄我已經
- > __ init__.py
- > hello.pyx
- > setup.py如何解決錯誤「編譯Cython文件錯誤」錯誤?
Iniside hello.pyx-
print "Hello World"
內部setup.py
from distutils.core import setup
from Cython.Build import cythonize
setup(ext_modules = cythonize("hello.pyx"))
當我exceute python setup.py build_ext --inplace
我得到這個錯誤 -
F:\bots\cython>python setup.py build_ext --inplace
Compiling hello.pyx because it changed.
Cythonizing hello.pyx
Error compiling Cython file:
------------------------------------------------------------
...
^
------------------------------------------------------------
cython:0:0: cython.hello is not available
Traceback (most recent call last):
File "setup.py", line 5, in <module>
ext_modules = cythonize("hello.pyx")
File "C:\Anaconda2\lib\site-packages\Cython\Build\Dependencies.py", line 778,in cythonize
cythonize_one(*args[1:])
File "C:\Anaconda2\lib\site-packages\Cython\Build\Dependencies.py", line 895, in cythonize_one
raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: hello.pyx
它工作過一次,它也生成hello.pyd,但在此之後,我使用conda安裝了幾個軟件包(tensorflow和其他)。但從那時起,它就無法工作,並給出了上述錯誤。
我已經在mingw installed using conda