Created
December 28, 2010 13:08
-
-
Save hannes-brt/757191 to your computer and use it in GitHub Desktop.
Setup pyximport to include the numpy headers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyximport | |
import numpy as np | |
pyximport.install(setup_args={'include_dirs': np.get_include()}) |
Note that this does not work on OS X with home-brewed python, since home-brew overrides the include_dirs parameter in /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/distutils.cfg
Another method like globally setting CFLAGS should be used. i.e. adding this to ~/.bash_profile:
export CFLAGS="-I/usr/local/lib/python2.7/site-packages/numpy/core/include/"
Thanks
Awesome. Thanks
Awesome :) Thanks a lot
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks