简体   繁体   English

安装Python2.6

[英]Installing Python2.6

I'm trying to install python 2.6 on LinuxMint. 我正在尝试在LinuxMint上安装python 2.6。 I've came across a few issues. 我遇到过一些问题。

The first thing I did was to download Python2.6.8 from the python website 我做的第一件事是从python网站下载Python2.6.8

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 我在这里找到了这个

When I run the make command, I get these errors: 当我运行make命令时,我收到以下错误:

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                                

I have installed all the packages mentioned in the Cheater's page. 我已经安装了Cheater页面中提到的所有软件包。 I successfully installed python2.6 without all the options that I mentioned, but I can't get the bz2 module to work. 我成功安装了python2.6而没有我提到的所有选项,但我无法让bz2模块工作。

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

Also, older versions of python don't look for files in the new locations where ubuntu (and I assume Mint by extension) installs them. 此外,旧版本的python不会在ubuntu(我假设Mint通过扩展名)安装它们的新位置查找文件。 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): 你需要打开setup.py并找到它定义各种库目录的地方,例如需要这个补丁来在新的ubuntus上编译python2.4(我看到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 = []

But what I would personally do is grab the debian sources , and attempt to build the package from source. 但我个人会做的就是抓住debian源代码 ,并尝试从源代码构建软件包。

Or you could just use the dead snakes ppa 或者你可以使用死蛇ppa

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

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