简体   繁体   English

多个Python发行版 - 管理包

[英]Multiple Python Distributions — Managing Packages

Ubuntu (10.10) came installed with Python2.6, 2.7, and 3. In addition, I have installed the Enthought Python Distribution. Ubuntu(10.10)安装了Python2.6,2.7和3.此外,我已经安装了Enthought Python Distribution。 Is there any way to manage Python packages within these distributions intelligently? 有没有办法智能地管理这些发行版中的Python包?

For compatibility, I'd imagine switching between these distributions occasionally. 为了兼容性,我想象偶尔在这些发行版之间切换。 If I install PyBlah , I'd like it to be available under all of the distributions. 如果我安装PyBlah ,我希望它可以在所有发行版下使用。 Can I do better than installing PyBlah under each distribution? 我能在每个发行下安装PyBlah做得更好吗?

Well you can't install a package across 2.x-3.x distributions, they're not compatable. 那么你不能跨2.x-3.x发行版安装一个包,它们是不兼容的。 So the easiest ( and recommended way) is to install it for each version. 所以最简单的(也是推荐的方法)是为每个版本安装它。

If you're sure you want to install it for all your versions, you can install it somewhere like ~/lib/python/ and add that directory to your PYTHONPATH . 如果您确定要为所有版本安装它,可以在~/lib/python/之类的地方安装它,并将该目录添加到PYTHONPATH

Virtualenv和virtualenvwrapper使管理包非常好!

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

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