在64位Linux上安装python 32位 [英] Install python 32 bit on 64 bit linux

查看:731
本文介绍了在64位Linux上安装python 32位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我基本上有两个问题:

  1. 如何在Linux上同时安装32位python和64位python?
  2. 如何从下面的失败尝试中修复损坏的系统?

我刚刚尝试在Linux Mint 16上同时安装32位python和64位python.这并不是我所希望的那样简单(类似sudo apt-get install python32会很好),但是经过一番谷歌搜索后,我下载了python 2.7.6并执行以下操作:

I just tried to install 32bit python alongside my 64bit python on linux mint 16. It's not as straight forward as I hoped for (something like sudo apt-get install python32 would be nice) but after a bit of googling I downloaded python 2.7.6 and did the following:

sudo apt-get install ia32-libs gcc-multilib checkinstall
CC="gcc -m32" LDFLAGS="-L/lib32 -L/usr/lib32 -Lpwd/lib32 -Wl,-rpath,/lib32 -Wl,-rpath,/usr/lib32" ./configure --prefix=/opt/pym32
make
sudo checkinstall

应该可以使我能够像这样运行32位和64位(默认):

The should supposedly make me able to run 32bit og 64bit (default) like this:

python -c 'import sys; print sys.maxint'
/opt/pym32/bin/python -c 'import sys; print sys.maxint'

...但是/opt/pym32/甚至都没有创建.更糟糕的是,我的系统现在报告了29个破坏的依赖关系,表明新的python取代了旧的python或类似的东西.为了解决此问题,aptitude建议我删除一堆所需的软件包,然后安装一堆不需要的软件包.

... but /opt/pym32/ wasn't even created. Worse, my system now reports 29 broken dependencies, indicating that the new python replaced the old one or something like that. To fix it, aptitude suggests that I remove a whole bunch of packages that I need and install a whole bunch of packages that I don't need.

如果出现问题,我使用checkinstall而不是make install来进行反向/卸载,但是由于损坏的依赖项,导致无法卸载/重新安装python.有办法摆脱这种混乱吗?

I used checkinstall rather than make install to be able to reverse/uninstall if something went wrong, but uninstalling/reinstalling python won't work because of the broken dependencies. Is there a way to get out of this mess?

推荐答案

我认为您应该使用虚拟环境,并在其中安装其他python版本.检查此答案以获得更好的理解-> 是可以在Virtualenv中安装另一个版本的Python吗?

I think you should use a virtual environment and install a different python version in it. Check this answer for better understanding --> Is it possible to install another version of Python to Virtualenv?

这篇关于在64位Linux上安装python 32位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆