I am trying to create a Docker image with graph-tool installed along with a
number of geospatial C libraries with Debian stretch OS. Everything but
graph-tool has been set up, and is available here ( https://hub.docker.com/r/kuanb/peartree/).
This appears to be successful. I then go into a Python3 repl and
attempt to import
graph_tool which results in a ModuleNotFoundError.
I suspect the error has to do with versions of Python3 and where the
library (graph-tool) is being placed versus where pip is placing its
libraries. Unfortunately, I am not entirely confident navigating this and
would be appreciative of any guidance - I suspect I am "almost there" and
someone on this list may be more familiar with setting this up and could
point me in the right direction.
As to your question as to if this is a custom Python install - I would
assume not? If it was, then that would have been set within the
instructions for creating that python:3.6-stretch image. It does appear
that Python is aware only of packages in /usr/local.
Re: my original issue. It turns out the ModuleNotFound error stemmed from
/usr/lib/python3/dist-packages/ having older versions of Numpy and Scipy.
Adding the PYTHONPATH first, then upgrading Numpy and Scipy (numpy==1.14.0
scipy==1.0.0) allowed me to import graph_tool successfully (and have it be
able to import the various dependencies it was err'ing on before).
If you have thoughts about the different versions of Python and some
cursory familiarity with the configuration of that Python 3.6 image; I'd be
interested in finding a less awkward solution than what I did to get
graph_tool up and running. Otherwise, I'd label this issue as "resolved."
Thanks.
As to your question as to if this is a custom Python install - I would
assume not? If it was, then that would have been set within the instructions
for creating that python:3.6-stretch image. It does appear that Python is
aware only of packages in /usr/local.
That can't be. The default Debian python install would never look in
/usr/local. It must be a custom install done in the docker image you are
referencing.
Re: my original issue. It turns out the ModuleNotFound error stemmed
from /usr/lib/python3/dist-packages/ having older versions of Numpy and
Scipy. Adding the PYTHONPATH first, then upgrading Numpy and Scipy
(numpy==1.14.0 scipy==1.0.0) allowed me to import graph_tool successfully
(and have it be able to import the various dependencies it was err'ing on
before).
I don't see how that would happen, but I'm glad it is working.
If you have thoughts about the different versions of Python and some cursory
familiarity with the configuration of that Python 3.6 image; I'd be
interested in finding a less awkward solution than what I did to get
graph_tool up and running. Otherwise, I'd label this issue as "resolved.
Just installing from a clean Debian install using the steps explained in the
graph-tool website should just work. The issues you describe seem to be due
to a custom python install.