手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

Python 环境安装步骤

[日期:2016-03-31] 来源:Linux社区  作者:wangxiaoqiangs [字体:大 中 小]

简介:

记录一下关于 Python 环境软件包的一些安装步骤

1、升级 Python 到 2.7.10( 默认 2.6.6 )

shell > yum -y install epel-release
shell > yum -y install gcc wget readline-devel zlib-devel openssl-devel

shell > wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz
shell > tar zxf Python-2.7.10.tgz
shell > cd Python-2.7.10 ; ./configure --prefix=/usr/local/python2.7 ; make ; make install

shell > mv /usr/bin/python /usr/bin/old_python
shell > ln -s /usr/local/python2.7/bin/python /usr/bin/python

shell > sed -i '1s/python/old_python/' /usr/bin/yum

shell > python -V
Python 2.7.10

 

## 这样就实现的 python 的升级
## readline-devel 这个包要事先安装,不然后面的 ipython 不支持 tab 、方向键等,还要重新编译 python
## zlib-devel 这个包 Setuptools 会用到,openssl-devel 这个包 pip 会用到
## /usr/bin/yum 文件解释器要改一下,不然无法使用 yum

2、安装 Setuptools

shell > wget https://pypi.python.org/packages/source/s/setuptools/setuptools-15.2.tar.gz#md5=a9028a9794fc7ae02320d32e2d7e12ee
shell > tar zxf setuptools-15.2.tar.gz
shell > cd setuptools-15.2 ; python setup.py install

shell > ln -s /usr/local/python2.7/bin/easy_install /usr/bin/easy_install

## 这样 Setuptools 也安装好了,如果不安装这个包直接下载 pip 源码包安装可能会报错说找不到 Setuptools

3、安装 pip

shell > wget https://pypi.python.org/packages/source/p/pip/pip-6.1.1.tar.gz#md5=6b19e0a934d982a5a4b798e957cb6d45
shell > tar zxf pip-6.1.1.tar.gz
shell > cd pip-6.1.1 ; python setup.py install

shell > ln -s /usr/local/python2.7/bin/pip /usr/bin/pip

## 这样 pip 也安装好了,当然,有了 easy_install 就可以直接 easy_install pip 了,源码只是另外一种安装方式

4、安装 ipython

shell > wget https://pypi.python.org/packages/source/i/ipython/ipython-3.1.0.tar.gz#md5=a749d90c16068687b0ec45a27e72ef8f
shell > tar zxf ipython-3.1.0.tar.gz
shell > cd ipython-3.1.0 ; python setup.py install

shell > ln -s /usr/local/python2.7/bin/ipython /usr/bin/ipython

## 这样 ipython 也安装好了,同样可以通过 pip install ipython 来快速安装

下面关于Python的文章您也可能喜欢,不妨看看:

Linux下Python的安装以及注意事项  http://www.linuxidc.com/Linux/2015-11/124861.htm

Ubuntu 14.04 下安装使用Python rq模块  http://www.linuxidc.com/Linux/2015-08/122441.htm

无需操作系统直接运行 Python 代码  http://www.linuxidc.com/Linux/2015-05/117357.htm

CentOS上源码安装Python3.4  http://www.linuxidc.com/Linux/2015-01/111870.htm

《Python核心编程 第二版》.(Wesley J. Chun ).[高清PDF中文版] http://www.linuxidc.com/Linux/2013-06/85425.htm

《Python开发技术详解》.( 周伟,宗杰).[高清PDF扫描版+随书视频+代码] http://www.linuxidc.com/Linux/2013-11/92693.htm

Python脚本获取Linux系统信息 http://www.linuxidc.com/Linux/2013-08/88531.htm

在Ubuntu下用Python搭建桌面算法交易研究环境 http://www.linuxidc.com/Linux/2013-11/92534.htm

Python 语言的发展简史 http://www.linuxidc.com/Linux/2014-09/107206.htm

Python 的详细介绍:请点这里
Python 的下载地址:请点这里 

本文永久更新链接地址:http://www.linuxidc.com/Linux/2016-03/129689.htm

linux
相关资讯       Python环境 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款