Benben Benben - 3 months ago 7
Python Question

Python 2.7 How to load a shared module on a virtual env

The graph-tool was installed to Ubuntu 16.04.1.

I would like to use the graph-too together with other Python modules which were installed on a virtual env.

Is there any way to use a shared module on a virtual env?

Answer

Create your virtualenv with the system site-packages directory included; use the --system-site-packages switch:

$ virtualenv --help
[...]
  --system-site-packages
                        Give the virtual environment access to the global
                        site-packages.
[...]

You can change this setting by re-running virtualenv on an existing virtual env directory, and disable it again by using the --no-site-packages switch.