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

查看:58
本文介绍了在 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 位 og 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天全站免登陆