Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Bad behavior of pyximport on OS X with home-brewed Python #1725
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
mosco commentedJun 2, 2017
Homebrew places a distutils.cfg file which overrides the include_dirs parameter. This means that setting include_dirs in the call to pyximport.install has no effect. Hence the (common) use case of building a Cython/numpy extension module with pyximport silently fails with no clear way to debug.
I am not quite sure who's fault it is. Perhaps Homebrew are at fault for placing a custom distutils.cfg. But as it is, this problem is very difficult to debug. Even a warning regarding the override would be a major improvement.
Reproducing
I'm using the latest homebrewed version of Python (2.7.13) with Cython (0.25.2).
testing.py:
import pyximport
import numpy
pyximport.install(setup_args={'include_dirs': numpy.get_include()})
import testing_pyx
testing_pyx.pyx:
import cython
cimport numpy