Binary and compiled version living together
Hello, I would like to start extending graph-tools, but I wonder if it is possible to have the official release (installed from the repository) along with a custom compiled version. I don't know how python manages the libraries, so I'm wondering if it is possible to either: - switch from one library to the other when running the python script (like changing the classpath when running a java program) - change the library name, so I could do something like "import graph_tool" to get the official version and "import graph_tool_mydevel" to get my modified version If it is there any other (maybe easier) solution, please let me know. Thanks, Giuseppe
Hi Giuseppe, On 07/22/2013 12:39 AM, Giuseppe Profiti wrote:
Hello, I would like to start extending graph-tools, but I wonder if it is possible to have the official release (installed from the repository) along with a custom compiled version. I don't know how python manages the libraries, so I'm wondering if it is possible to either: - switch from one library to the other when running the python script (like changing the classpath when running a java program)
You can specify the python module path by setting the environment variable named PYTHONPATH. You can install the different versions in different directories, and change the value of this variable each time you want to switch versions. This can also be automated using the virtualenv package: http://www.virtualenv.org Just google PYTHONPATH and/or virtualenv and you will find all sorts of guides/howtos.
- change the library name, so I could do something like "import graph_tool" to get the official version and "import graph_tool_mydevel" to get my modified version
This wont work, since the module refers to itself internally at some places by its standard name... You would have to change all theses references as well. Cheers, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de>
participants (2)
-
Giuseppe Profiti -
Tiago de Paula Peixoto