简体   繁体   English

安装两个版本的Python模块

[英]Install two versions of a Python module

I am currently using the current release version (v1.12) of a module (graph-tool). 我当前正在使用模块(图形工具)的当前发行版本(v1.12)。 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. 但是,目前也可以通过Git获得一个正在开发的版本(v1.13),其中包含一些发行版中未实现的功能。 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? 我知道我可以在将其编译并安装到硬盘驱动器后以其他名称将其导入python,但是如何在不覆盖旧版本文件的情况下进行编译? I am using Ubuntu 14.04. 我正在使用Ubuntu 14.04。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM