在 Debian 上安装第二个 python
所以我有 Debian 机器作为我的 Django 生产服务器。 我需要安装第二个 python (2.7.1) 才能与 virtualenv 一起使用。 但它总是写我没有一些模块,然后我必须手动搜索,apt-install它们并重建。有没有办法解决构建的依赖关系,或者使用 python 2.7.1 为 Debian Squeeze 预编译 .deb? 抱歉,如果这是一个菜鸟问题,老实说,我用谷歌搜索过。
So I have Debian machine for my Django production server.
I need to install second python (2.7.1) to use with virtualenv.
But it always write I don't have some modules, then I have to search manually, apt-install them and rebuild. Is there either a way to resolve the dependencies for building, or pre-compiled .deb with python 2.7.1 for Debian Squeeze?
Sorry if this is much of a noobie question, I googled, honestly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
获取 Python 2.7.1 源代码并手动编译:
Get the Python 2.7.1 sources and compile it manually:
Python 2.7 可用于 wheezy(测试),因此您应该能够安装通过添加
testing
存储库并执行一些 APT 固定。1) 在 /etc/apt/sources.list 中添加存储库
2) 在 /etc/apt/preferences 中进行实际固定
A
Pin-优先级
低于500基本上意味着不会自动安装来自testing
的软件包,因此其他软件包不会出现问题。3) 安装
python2.7
来自testing
:(如果您没有
aptitude
,则使用apt-get
)Python 2.7 is available for wheezy (testing), so you should be able to install it by adding the
testing
repository and doing some APT pinning.1) add the repository in /etc/apt/sources.list
2) do the actual pinning in /etc/apt/preferences
A
Pin-Priority
of under 500 basically means that no packages fromtesting
are installed automatically, so you won't have problems with other packages.3) install
python2.7
fromtesting
:(or
apt-get
if you don't haveaptitude
)以下是 Debian GNU/Linux 6.0.7(2013 年 7 月 18 日)的两种方法:
经典的
安装依赖项
下载 python
编译
安装
测试
升级 pip virtualenv
创建用户及其 virtualenv
再次测试
“pythonic”
使用包 pyenv。
Here is two methods for Debian GNU/Linux 6.0.7 (on 18/07/2013):
The classic
Install dependencies
Download python
Compile
Install
Test
Upgrade pip virtualenv
Create an user and its virtualenv
Test again
The "pythonic"
Use the package pyenv.
使用 debootstrap 安装 chroot 环境也是一种快速且安全的解决方案。
它使用约300mb
Installing a chroot-environment with debootstrap could be also a fast and secure solution.
It uses about 300mb
您可以使用pythonbrew安装和切换python版本我在Debian 6和Debian 7中安装了python 2.7.3和python 2.7.9并且工作正常。
您可以按照本教程pythonbrew howto
You can install and switch python versions using pythonbrew I installed python 2.7.3 and python 2.7.9 in Debian 6 and Debian 7 and works fine.
You can follow this tutorial pythonbrew howto