+++++++++++++++++++++++++++++++++++++++++++
标题:python2.7.14安装部署(Linux)
时间:2019年2月23日
内容:Linux下python环境部署(2.7.14)以及学习如何能够更简单的安装python的模块
重点:python环境部署,如何简单的安装python的模块
+++++++++++++++++++++++++++++++++++++++++++
1. 实验环境
操作系统:centos Linux 6.6 X86 64bit
python:2.7.14版本
2. 部署python安装环境
# yum groupinstall 'Development Tools'
# yum install zlib-devel bzip2-devel openssl-devel ncurses-devel
3. 编译安装python2.7.14
# wget https://www.python.org/ftp/python/2.7.14/Python-2.7.14.tgz
# tar zxvf Python-2.7.14.tgz
# cd Python-2.7.14.tgz
# ./configure //编译环境,其中存在较多的编译参数,可以通过--help查看
# make && make install //过程需要一段时间
# ll /usr/local/bin/python
/usr/local/bin/python2.7
/usr/local/bin/python2.7-config
# python --version //处理原版本(一定要先安装好其他的软件之后再处理原版本,因为yum本身是依赖于python)
# mv /usr/bin/python /usr/bin/python2.6.old
# rm -rf /usr/bin/python-config //该文件为软链接文件,可直接删除
# ln -s /usr/local/bin/python2.7 /usr/bin/python //创建软链接,调用python命令
# ln -s /usr/local/bin/python2.7-config /usr/bin/python-config
# python --version //查看python版本是否已经更新
5. 为python安装setuptools
# wget https://pypi.io/packages/source/s/setuptools/setuptools-33.1.1.zip
# unzip setuptools-33.1.1.zip
# cd setuptools-33.1.1
# python setup.py install
6. 安装python
# easy_install pip
# easy_install bs4 //其他模块类似安装