I've been having trouble installing pyosmium on OS X 10.8 with the Canopy installation of Python. I'm not sure where the headers should go, and I get different install errors depending on where I try.
I've installed the dependencies (Boost.Python, osmium, etc.). I think the problem is related to the location of the Canopy Python installation compared to these dependencies. See this thread on similar challenges installing Boost with Canopy.
I've tried installing Boost (and Boost Python) and osmium into: /usr/local/include
I then run
python setup.py build
to install pyosmium, and get the error:
lib/osmium.cc:3:10: fatal error: 'osmium/visitor.hpp' file not found
Adding a symbolic link to the osmium directory to /Library/Enthought/Canopy_64bit/User/include/, I get the error: /usr/local/include/osmium/visitor.hpp:36:10: fatal error: 'type_traits' file not found
If I install them in /Users/[username]/Library/Enthought/Canopy_64bit/User/include/, I get: Traceback (most recent call last): File "setup.py", line 31, in raise Exception("Cannot find boost_python library")
Other permutations raise similar errors. Ideas would be much appreciated!
UPDATE: after more trying, the problem seems to be that setup.py
for pyosmium cannot find the boost headers. I added the path to boost to the includes
list in setup.py
. However, it still can't find type_traits and the other boost headers.
> $ python setup.py build
> running build
> running build_py
> running build_ext
> building 'osmium._osmium' extension
> gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -DNDEBUG -g -O3 -arch x86_64 -I/usr/local/include/boost_1_57_0 -I/usr/include -I../libosmium/include -I../boost -I/Applications/Canopy.app/appdata/canopy-1.5.0.2717.macosx-x86_64/Canopy.app/Contents/include/python2.7 -c lib/osmium.cc -o build/temp.macosx-10.6-x86_64-2.7/lib/osmium.o -std=c++11 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
> In file included from lib/osmium.cc:3:
> /usr/local/include/osmium/visitor.hpp:36:10: fatal error: 'type_traits' file not found
> #include <type_traits>
^
> 1 error generated.
> error: command 'gcc' failed with exit status 1