问题描述
我想将ubuntu 8.04随附的默认python安装(2.5.2)升级到python 2.6rc2.我想将2.6设置为系统上的默认python版本,并将安装在2.5.2上的所有其他有用的已安装python库迁移到python 2.6rc2.请让我知道我如何实现这一目标.
I'd like to how to upgrade the default python installation(2.5.2) supplied with ubuntu 8.04 to python 2.6rc2. I'd like to make 2.6 the default python version on the system and migrate all the other useful installed python libraries installed on 2.5.2 to python 2.6rc2. Please let me know how I can achieve this.
谢谢德克
推荐答案
警告我认为用未发布的beta版本替换默认Python是一个非常糟糕的主意:
With the warning that I think it's a tremendously bad idea to replace the default Python with an unreleased beta version:
首先,安装2.6rc2.您可以从 Python网站下载该源.标准的./configure && make && sudo make install
安装样式.
First, install 2.6rc2. You can download the source from the Python website. Standard ./configure && make && sudo make install
installation style.
接下来,删除/usr/bin/python
符号链接. 不不要删除/usr/bin/python2.5
.使用ln -s /usr/local/bin/python2.6 /usr/bin/python
将符号链接添加到2.6.
Next, remove the /usr/bin/python
symlink. Do not remove /usr/bin/python2.5
. Add a symlink to 2.6 with ln -s /usr/local/bin/python2.6 /usr/bin/python
.
再一次,我认为这是一个糟糕的主意.几乎可以肯定,有一种更好的方法可以完成您要完成的所有任务.
Once again, I think this is a terrible idea. There is almost certainly a better way to do whatever you're trying to accomplish.
迁移已安装的库要花费更长的时间.在/usr/lib/python2.5/site-packages/
和/usr/local/lib/python2.5/site-packages/
目录中查找.安装到它们的所有库都需要使用2.6重新安装.由于您未使用打包的Python版本,因此无法使用Ubuntu的软件包-您必须自己手动升级所有库.他们中的大多数人可能可以用sudo easy_install <name>
安装,但是像PyGTK +这样的工具并不是那么容易.您必须遵循每个此类库的自定义安装过程.
Migrating installed libraries is a much longer process. Look in the /usr/lib/python2.5/site-packages/
and /usr/local/lib/python2.5/site-packages/
directories. Any libraries installed to them will need to be re-installed with 2.6. Since you're not using a packaged Python version, you cannot use Ubuntu's packages -- you'll have to manually upgrade all the libraries yourself. Most of them can probably be installed with sudo easy_install <name>
, but some like PyGTK+ are not so easy. You'll have to follow custom installation procedures for each such library.
这篇关于如何在ubuntu linux 8.04上将python 2.5.2升级到python 2.6rc2?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!