0

I am currently using the current release version (v1.12) of a module (graph-tool). There however is a version currently under development (v1.13) available too via Git which contains some functions that are not implemented in the release version. I would like to use these functions but seeing as I don't know how stable it will run I am not sure if I want to overwrite the currently installed version. The dev version, to my knowledge, will have to be compiled from source. I know I can import it into python under a different name once I have compiled it and installed it on my hard drive but how do I go about compiling it without overwriting the files of the old version? I am using Ubuntu 14.04.

P-M
  • 1,279
  • 2
  • 21
  • 35

1 Answers1

2

If you're not already doing it you could use a virtual environment and install the dev version in that one. That would require you to copy over your files as well, but it will provide a safe way to explore the dev version of your dependency.

$ pip install virtualenv
$ cd my_project_folder
$ virtualenv venv
Jim Aho
  • 9,932
  • 15
  • 56
  • 87
  • Thank you for the response! I have edited the question as I realise it may not have been entirely clear. My issue is not around loading the module into python but rather making sure that the compilation of the files does not replace the files of the old module. Does a virtual environment help with that? – P-M Feb 29 '16 at 14:41
  • I guess a compilation will produce *some kind of* result, and you can put this result whereever you want. If you put this result (the module) inside your virtual environment my guess is it'll work just fine. – Jim Aho Feb 29 '16 at 14:49
  • A python virtual env will give you a copy of all neccessary files to run python. You can do anything with these and still not mess up your "original" installation. – Jim Aho Feb 29 '16 at 14:51
  • I can see that potentially helping me inside Python, but wouldn't `./configure` and `make install` possibly still overwrite the initial install? What I guess I might really need is a way for me to specify the desired install directory for `./configure` but I am not sure how I go about doing that. – P-M Feb 29 '16 at 17:46