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

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