文章标题
来源:互联网 发布:a卡吃鸡优化 编辑:程序博客网 时间:2024/05/22 15:55
本文是我整理的64位的ubuntu16.04系统安装python2.7.9详细步骤,虽然ubuntu16.04系统下默认安装了python2.7.13但是我们还是可以多熟练一下安装环境,这样对以后的学习更加得心应手一点。
ubuntu16.04系统下默认安装了python2.7.12,在/usr/bin/下可以找到, 默认用python2.7.12
aright@ubuntu:~$ python –version
Python 2.7.12
aright@ubuntu:~$ python2.7 –version
Python 2.7.12
现在python官网出了python2.7系列的python2.7.9, 好了, 现在我们尝试着安装python2.7.9
python在ubuntu下有几种安装方法:
通过ubuntu官方的apt工具包安装
通过PPA(Personal Package Archive) 的apt工具包安装
通过编译python源代码安装
网上查 方法一
通过ubuntu官方的apt工具包安装
sudo apt-get install python2.7
sudo apt-get install python3.4
方法二
从PPA(Personal Package Archives) 安装apt工具包
并不好用
类似使用apt工具包安装python的工具虽然简单, 但有时不一定能够安装到最新版本。因此, 在python出现重要更新时, 我们最好学会以从源代码直接编译安装python2.7.
我用的是
从源代码编译安装python
$ wget -c https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz
$ sudo make install
安装完成后, 可以用下面的命令进行确认
aright@ubuntu:~$ python2.7 –version
Python 2.7.9
其中, 上面的wget -c (url)是下载命令,参数-c表示支持断点下载, url是目标文件下载的绝对路径
“-L/usr/lib/x86_64-linux-gnu”中的x86_64-linux-gnu在/usr/lib/下可以找到, 这是x86_64可以看出我的系统是64的, 这里根据自己的系统进行键入。
好了, 安装完后我们检测下, 终端键入python –version, 回车, 再键入which python
@ubuntu:~
/usr/local/bin/python
aright@ubuntu:~$
可见, python2.7.9安装成功, 并且发现我们默认的python版本变成了python2.7.9。这是因为操作系统在搜索命令时, 是按照PATH环境变量的顺序依次进行搜索的,
/usr/local/bin/下的python会比/usr/bin/下的python优先搜索到, 并作为默认的python版本。
当然, 我们也可以指定python的路径, 为查看python的版本, 如下:
aright@ubuntu:~
Python 2.7.9
aright@ubuntu:~$
至此, 我们就已经介绍完了python在ubuntu下的安装方法。
OK, Enjoy it!!!
我们键入pip freeze来看看已安装的python模块:
xx@ada:~$ pip freeze
adium-theme-ubuntu==0.3.4
apt-xapian-index==0.46
ccsm==0.9.12
characteristic==0.1.0
chardet==2.2.1
colorama==0.3.1
command-not-found==0.3
compizconfig-python==0.9.12
debtagshw==0.1
defer==1.0.6
dirspec==13.10
duplicity==0.6.23
gevent==1.0.1
greenlet==0.4.5
html5lib==0.999
httplib2==0.9
idna==0.9
lockfile==0.8
lxml==3.3.6
oauthlib==0.6.1
oneconf==0.3.7
PAM==0.4.2
pbr==0.10.7
pexpect==3.2
Pillow==2.6.1
piston-mini-client==0.7.5
pyasn1==0.1.7
pyasn1-modules==0.0.5
pycrypto==2.6.1
pycups==1.9.67
pycurl==7.19.5
pygobject==3.14.0
pyOpenSSL==0.13.1
pyserial==2.6
python-apt===0.9.3.10ubuntu1
python-debian==0.1.22
pyxdg==0.25
reportlab==3.1.8
requests==2.3.0
service-identity==1.0.0
sessioninstaller==0.0.0
six==1.7.3
software-center-aptd-plugins==0.0.0
stevedore==1.1.0
system-service==0.1.6
Twisted-Core==14.0.2
Twisted-Web==14.0.2
unity-lens-photos==1.0
urllib3==1.8.3
virtualenv==12.0.4
virtualenv-clone==0.2.5
virtualenvwrapper==4.3.1
wheel==0.24.0
xdiagnose==3.6.6
zope.interface==4.1.1
好了,到了这这里,你的python2.7.9已经安装在64位的ubuntu14.10系统上了,是不是感觉比想象中简单。
- 文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题 文章标题 文章标题 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- AWK手册
- Java与对称加密、非对称加密算法
- Linux系统基本网络配置
- css的定位
- IT基础2
- 文章标题
- IT基础3
- 二叉查找树(二叉排序树)Java实现
- IT基础4
- Python的numpy库中的shape用法
- IT基础5
- mysql Access denied for user root@localhost错误解决方法
- 树与二叉树的转化
- IT基础6