安装Python2.6 [英] Installing Python2.6
问题描述
我正在尝试在LinuxMint上安装python 2.6.我遇到了一些问题.
I'm trying to install python 2.6 on LinuxMint. I've came across a few issues.
我要做的第一件事是从 python网站
The first thing I did was to download Python2.6.8 from the python website
然后,我提取了文件,运行了
Then, I've extracted the files, ran a
./configure --prefix=/opt/python-2.7.3 --with-threads --with-signal-module --with-pydebug
我在
I found this here which I found here
运行make
命令时,出现以下错误:
When I run the make
command, I get these errors:
Failed to find the necessary bits to build these modules:
_bsddb _curses _curses_panel
_hashlib _sqlite3 _ssl
bsddb185 bz2 dbm
dl gdbm imageop
linuxaudiodev ossaudiodev readline
sunaudiodev
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
Failed to build these modules:
crypt nis
我已经安装了Cheater页面中提到的所有软件包. 我成功安装了python2.6,但没有提到我所有的选项,但是我无法使bz2模块正常工作.
I have installed all the packages mentioned in the Cheater's page. I successfully installed python2.6 without all the options that I mentioned, but I can't get the bz2 module to work.
推荐答案
我认为您可能缺少一些开发包.检查您是否具有以下条件:
I think you're probably missing a few development packages. Check that you have these:
dpkg -l libreadline-dev
dpkg -l zlib1g-dev
dpkg -l libssl-dev
此外,较早版本的python不在ubuntu(我假设扩展名为Mint)安装文件的新位置中查找文件.您需要打开setup.py并查找它定义各种库目录的位置,例如,需要此补丁才能在新的ubuntus上编译python2.4(我看到这样的修复在2.6上仍然是必需的):
Also, older versions of python don't look for files in the new locations where ubuntu (and I assume Mint by extension) installs them. You need to open up setup.py and look for the place where it defines the various library directories, eg this patch was needed to compile python2.4 on new ubuntus (and I see a fix like this is still necessary on 2.6):
diff -urNad python2.4-2.4.6-natty~/setup.py python2.4-2.4.6-natty/setup.py
--- python2.4-2.4.6-natty~/setup.py 2011-07-27 14:42:03.000000000 +0200
+++ python2.4-2.4.6-natty/setup.py 2011-07-27 15:03:35.000000000 +0200
@@ -269,6 +269,7 @@
lib_dirs = self.compiler.library_dirs + [
'/lib64', '/usr/lib64',
'/lib', '/usr/lib',
+ '/usr/lib/i386-linux-gnu', '/usr/lib/x86_64-linux-gnu',
]
inc_dirs = self.compiler.include_dirs + ['/usr/include']
exts = []
但是我个人要做的是获取 debian来源,并尝试构建来自源的软件包.
But what I would personally do is grab the debian sources, and attempt to build the package from source.
或者您可以只使用死蛇ppa
这篇关于安装Python2.6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!