标签:进入 from 添加 install too pre open 源码安装 cal
CentOS 7
Python 3.6.5
# yum install -y openssl-static
# yum install -y gcc wget
# yum groupinstall "Development tools"
# yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
# wget http://python.org/ftp/python/3.6.5/Python-3.6.5.tar.xz
# tar xf Python-3.6.5.tar.xz
进入Python-3.6.5文件夹下,进行编辑安装
# ./configure --prefix=/usr/local/python3
# make & make install
# ln -s /usr/local/python3/bin/python3 /usr/bin/python3
查看python3版本信息
# python3 -V
Python 3.6.5
查看pip版本信息
# python3 -m pip -V
pip 9.0.1 from /usr/local/lib/python3.6/site-packages (python 3.6)
添加pip的文件连接
# ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
查看pip版本信息
# pip3 -V
pip 9.0.3 from /usr/local/lib/python3.6/site-packages (python 3.6)
下载pip
# wget https://bootstrap.pypa.io/get-pip.py
安装pip
# python3 get-pip.py
查看pip版本信息
# python3 -m pip -V
pip 9.0.3 from /usr/local/lib/python3.6/site-packages (python 3.6)
编辑/etc/profile文档,在末尾添加如下,并保存退出。
export PATH="/usr/local/python3/bin:$PATH"
然后运行
# source /etc/profile
查看pip版本信息
# pip3 -V
pip 9.0.3 from /usr/local/lib/python3.6/site-packages (python 3.6)
标签:进入 from 添加 install too pre open 源码安装 cal
原文地址:https://www.cnblogs.com/lty-fly/p/9070069.html