Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building graph-tool on OSX with Python 3.4

I tried to install graph-tool on Mac OSX 10.10 using homebrew. The brew build process works fine, but when I try to import graph-tool I get the error described in this question. Another problem with homebrew is that I always builds graph-tool for python2.7 and it installs the packages in the Python 2.7 sit-packages folder. But I want to use it with Python 3.4. These are the reasons why I tried to build graph-tool from source.

The ./configure command automatically uses Python 2.7, too. So I passed it the desired Python version with ./configure PYTHON=python3.4

It then detects the correct version as well as the related paths but crash with the following error:

configure: error:
Could not link test program to Python. Maybe the main Python library has been installed in some non-standard library path. If so, pass it to configure, via the LDFLAGS environment variable.
Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib"

====================================================================== ERROR! You probably have to install the development version of the Python package for your distribution. The exact name of this package varies among them.

======================================================================

The error occurs with and without PYTHON variable set. From the output of ./configure I can see that everything works fine except for the last line, which says:

checking consistency of all components of python development environment... no

Whats does the above line mean and how do I properly install graph-tool on my maschine?

like image 759
MaxPowers Avatar asked Oct 30 '22 23:10

MaxPowers


1 Answers

The error message is explaining exactly what needs to be done. Since python was installed in a non-standard path, you need to pass the flag LDFLAGS="-L/usr/non-standard-path/python/lib" pointing to the directory where the python libraries are located. This is most likely "/usr/local/lib", if you are using homebrew.

like image 158
Tiago Peixoto Avatar answered Nov 12 '22 21:11

Tiago Peixoto