简体   繁体   English

在64位linux上安装python 32位

[英]Install python 32 bit on 64 bit linux

I basically have two questions: 我基本上有两个问题:

  1. How do you install 32bit python alongside 64bit python on linux? 你如何在Linux上安装32位python和64位python?
  2. How do I fix my broken system from the failed attempt below? 如何从下面的失败尝试中修复损坏的系统?

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: 我只是尝试在linux mint 16上安装32位python和我的64位python。它不像我希望的那样直接(像sudo apt-get install python32会很好)但是经过一些谷歌搜索我下载了python 2.7.6并做了以下事情:

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

The should supposedly make me able to run 32bit og 64bit (default) like this: 应该让我能够像这样运行32位og 64bit(默认):

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

... but /opt/pym32/ wasn't even created. ...但是/ opt / pym32 /甚至没有创建。 Worse, my system now reports 29 broken dependencies, indicating that the new python replaced the old one or something like that. 更糟糕的是,我的系统现在报告了29个破坏的依赖项,表明新的python取代了旧的python或类似的东西。 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. 为了解决这个问题,aptitude建议我删除一大堆我需要的软件包并安装一大堆我不需要的软件包。

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. 如果出现问题,我使用checkinstall而不是make install来反向/卸载,但卸载/重新安装python因为依赖性破坏而无法正常工作。 Is there a way to get out of this mess? 有没有办法摆脱这个烂摊子?

I think you should use a virtual environment and install a different python version in it. 我认为你应该使用虚拟环境并在其中安装不同的python版本。 Check this answer for better understanding --> Is it possible to install another version of Python to Virtualenv? 查看此答案以便更好地理解 - > 是否可以在Virtualenv中安装另一个版本的Python?

You might be better off building your own RPM. 你可能最好建立自己的RPM。 You could even automate it by pulling the latest version (or the one you want). 您甚至可以通过拉动最新版本(或您想要的版本)来自动化它。 Then you could set your own dependancies. 然后你可以设置自己的依赖。 Install the 64 bit to keep your dependancies sane. 安装64位以确保您的依赖性。

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

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