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
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.)
Install pyrex first and it will work.
Do the following: sudo pip install pyrex
python3.6 -m pip install Cython
Installing Cython solves the problem for me!
The only solution to this problem for me, when attempting to install pyFFTW
, was to first install Cython
via pip
. Also see https://github.com/pyFFTW/pyFFTW/issues/252 .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With