linux安装32位python_在64位Linux上安装python 32位

I basically have two questions:

How do you install 32bit python alongside 64bit python on linux?

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:

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:

python -c 'import sys; print sys.maxint'

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

... 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.

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?

解决方案

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?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值