.pyx文件的未知文件类型错误

ebr*_*ert 10 python

我正在尝试构建一个包含*.pyx文件的Python包(pyregion),并且在构建过程中会出现错误.检查以下输出:

$ python setup.py build
running build
running build_py
creating build
creating build/lib.macosx-10.5-x86_64-2.7
....
running build_ext
building 'pyregion._region_filter' extension
C compiler: gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -DNDEBUG -g -O3 -arch x86_64

error: unknown file type '.pyx' (from 'src/_region_filter.pyx')
Run Code Online (Sandbox Code Playgroud)

关于问题可能是什么的任何想法?需要注意的是,我在OSX上使用了Enthought构建的Python(7.1)和最新的Xcode(4.1).

干杯

Fre*_*Foo 6

.pyx应应当编译至C和Pyrex然后编译为目标代码.检查src/_region_filter.c分发中是否存在文件并破解setup.py脚本以构建该文件.(另外,考虑提交错误报告,因为这不应该发生.)


小智 5

python3.6 -m pip 安装 Cython

安装 Cython 解决了我的问题!