Bad behavior of pyximport on OS X with home-brewed Python #1725

Open
mosco opened this Issue Jun 2, 2017 · 0 comments

Comments

Projects
None yet
1 participant

mosco commented Jun 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment