centos6.7 安装python2.7、pip2.7、easy_install-2.7的方法
投稿:mdxy-dxy
这篇文章主要介绍了centos6.7 安装python2.7、pip2.7、easy_install-2.7的方法,需要的朋友可以参考下
centos6自带python2.6版本,根据需要,安装python2.7、easy_install-2.7、pip2.7
依赖
yum groupinstall -y Development tools yum install -y zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
安装Python2.7
wget https://www.python.org/ftp/python/2.7.11/Python-2.7.11.tgz tar xvf Python-2.7.11.tgz cd Python-2.7.11 ./configure --prefix=/usr/local make && make install && echo OK
安装完后的Python的可执行文件目录是 /usr/local/bin
安装完后的python安装目录路径是 /usr/local/lib/python2.7
此时可通过python2.7命令验证安装
安装 setuptools(easy_install-2.7) + pip2.7
注意:一定要使用 python2.7 来执行相关命令
# 下载setuptools,easy_install 的安装包 wget https://bootstrap.pypa.io/ez_setup.py #安装easy_install-2.7 python2.7 ez_setup.py #安装完成后/usr/local/bin/目录下出现easy_install-2.7 #安装pip2.7 easy_install-2.7 pip #安装完成后/usr/local/bin/目录下出现pip2.7 #升级pip2.7版本 pip2.7 install --upgrade pip
至此easy_install-2.7、pip2.7安装完成
pip2.7 install [packagename] pip2.7 install --upgrade [packagename] pip2.7 uninstall [packagename]