root@nagat-Presario-CQ42-Notebook-PC:/# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 11.10
Release: 11.10
Codename: oneiric
$ tar –jxvf Python-3.2.2.tar.bz2
$ cd Python-3.2.2
$ ./configure
$ make
Python 2.7.2+ (default, Oct 4 2011, 20:03:08)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
[5]+ 已停止 python
root@nagat-Presario-CQ42-Notebook-PC:/# python3
Python 3.2.2 (default, Apr 2 2012, 13:44:15)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 11.10
Release: 11.10
Codename: oneiric
lz ubuntu版本11.10,自带pyython 2.7
1.下载python 3.2
打开此页面选择,你需要的版本
http://www.python.org/getit/releases/3.2.2/
或者直接下载此版本
http://www.python.org/ftp/python/3.2.2/Python-3.2.2.tar.bz2
$ tar –jxvf Python-3.2.2.tar.bz2
$ cd Python-3.2.2
$ ./configure
$ make
$ make install
如果报错,没有权限,请查看 切换root用户
3. 测试 是否成功
root@nagat-Presario-CQ42-Notebook-PC:/# pythonPython 2.7.2+ (default, Oct 4 2011, 20:03:08)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
[5]+ 已停止 python
root@nagat-Presario-CQ42-Notebook-PC:/# python3
Python 3.2.2 (default, Apr 2 2012, 13:44:15)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
可见python和python3都可运行,python是系统自带的2.7,python3是自己安装的3.2
which查看他们的位置,如下:
root@nagat-Presario-CQ42-Notebook-PC:/# which python
/usr/bin/python
root@nagat-Presario-CQ42-Notebook-PC:/# which python3
/usr/local/bin/python3
root@nagat-Presario-CQ42-Notebook-PC:/#