Answer a question

I'm trying to build a Python package (pyregion) that contains a *.pyx file and error comes during the build process. Checking out the below output:

$ 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')

Any ideas on what the issue could be? Just to note, I'm using the Enthought build of Python (7.1) on OSX with the latest Xcode (4.1).

Cheers

Answers

The .pyx should should be compiled to C with Pyrex and then compiled to object code. Check if a src/_region_filter.c file is present in the distribution and hack the setup.py script to build that instead. (Also, consider filing a bug report, since this shouldn't be happening.)

Logo

Python社区为您提供最前沿的新闻资讯和知识内容

更多推荐