2

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
scai
  • 20,297
  • 4
  • 56
  • 72
amball
  • 293
  • 3
  • 17
  • `type_traits` is a C++ header. Do you have g++ installed? – scai Mar 15 '15 at 11:05
  • Thanks, scai. I'm not sure. I installed the Xcode developer tools, which allowed me to do the builds. Is there a way that I can check for g++ or install it? Having said that, I can see type_traits.hpp in my usr/local/include/boost_1_57_0/boost directory – amball Mar 15 '15 at 19:04
  • No idea how you can check that on OS X. On Linux there will be a file similar to `/usr/include/c++/4.9/type_traits`, depending on your gcc/g++ version. – scai Mar 15 '15 at 20:47
  • OK, g++ is installed. type_traits is not in the /usr/include/c++/4.2.1 directory, but it is in my usr/local/include/boost_1_57_0/boost directory -- which I added to the include path. – amball Mar 15 '15 at 23:29

0 Answers0