There is no guarantee that this will work, i wrote this so in case anyone else have the same goal in mind. Using: Ubuntu 16.04; miniconda2
- use graph-tool
- all other packages should fall in a virtual environment
- I attempted to build graph-tool from scratch but did not work, and couldnt seem to pull everything together.
- Attempt to use all the graph-tool packages on anaconda cloud... (idgi)
-
.deb
from graph-tool is installed: sudo apt-get install python-graph-tool -
All the additional apt-get binaries are installed too, and check (see next section)
-
Create conda environment (if you havent), otherwise, activate the environment: a.
conda create -n <env> python=2.7
# quite sure this is extensible to the python3 b.source activate <env>
-
install the conda packages
conda install numpy scipy matplotlib cairo pycairo
This has to be done so that graph-tool does not use the system's packages but rather your numpy/scipy/... packages! also because, this works and if not it doesnt... -
link the
dist-packages
where yourgraph_tool
exists (on the system)
$ cd /path/to/anaminiconda/envs/<env>/lib/python2.7/site-packages
$ touch dist-packages.pth
$ echo "/usr/lib/python2.7/dist-packages/" >> dist-packages.pth
# or you can open your text editor and type the path to your dist-packages into the file `dist-packages.pth`
This would tell conda to look at your dist-packages should you tried to import sth that is not in the site-packages
- Check that graph-tool is properly installed!
check that graph-tool is properly installed:
in a terminal:
$ which python
/usr/bin/python # ensure that you are using the system's python
$ python -c "from graph_tool.all import *"
# WARNING messages are okay, as long as it does not throw ImportError,
# or any of that sort that means that the installation has failed
# in your conda environment:
<env> $ python -c "from graph_tool.all import *"
If no errors are thrown, then you are good :)
nice workaround, thanks!