Ubuntu上的Python 2.7 [英] Python 2.7 on Ubuntu

查看:130
本文介绍了Ubuntu上的Python 2.7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Python的新手,正在Linux机器上工作(Ubuntu 10.10).它正在运行python 2.6,但是我想运行2.7,因为它具有我要使用的功能.我被敦促不要安装2.7并将其设置为我的默认python.

I am new to Python and am working on a Linux machine (Ubuntu 10.10). It is running python 2.6, but I'd like to run 2.7 as it has features I want to use. I have been urged to not install 2.7 and set that as my default python.

我的问题是,我如何安装2.7并使其与2.6并排运行?

My question is, how can I install 2.7 and run it side by side with 2.6?

推荐答案

我在Ubuntu 10.10机器上使用 pythonbrew 做到了.

I did it with pythonbrew on my Ubuntu 10.10 machine.

$ python -V
Python 2.6.6
$ curl -kL https://raw.github.com/utahta/pythonbrew/master/pythonbrew-install | bash
$ . $HOME/.pythonbrew/etc/bashrc
$ pythonbrew install 2.7.1
$ pythonbrew switch 2.7.1
Switched to Python-2.7.1
$ python -V
Python 2.7.1

我还使用它来安装Python 3.2 .

这篇关于Ubuntu上的Python 2.7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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