转自:https://blog.csdn.net/yangczcsdn/article/details/80843739?utm_source=blogxgwz4
linux : centos 7
一:安装python3.5
#安装gcc,否则在./configure时会error
yum install gcc
#安装openssl-devel,否则会忽略pip安装失败,但是没有error
yum install openssl-devel
#安装python3
wget https://www.python.org/ftp/python/3.5.3/Python-3.5.3.tar.xz
xz -d Python-3.5.3.tar.xz
tar -xvf Python-3.5.3.tar
mv Python-3.5.3 /usr/local/python35
cd /usr/local/python35
./configure
make
make install
最后一步:设置快捷软连接
配置软连接
ln -s /usr/local/python3/python /usr/bin/python3
二:安装pip
wget --no-check-certificate https://pypi.python.org/packages/source/p/pip/pip-8.0.2.tar.gz#md5=3a73c4188f8dbad6a1e6f6d44d117eeb
tar -zxvf pip-8.0.2.tar.gz
mv pip-8.0.2 /usr/local/pip3
cd /usr/local/pip3
python3 setup.py build
python3 setup.py install
测试: pip3 install falsk (pip3 是为了与linux自带python2版本的pip进行区分)
然后:python3 回车
输入:import flask 产看成功与否
此pip3安装包不是最新版本,可以进行安装,但是会提示两行黄色的警告,提示升级pip包
升级方法:pip3 install --upgrade pip
---------------------
作者:yangczcsdn
来源:CSDN
原文:https://blog.csdn.net/yangczcsdn/article/details/80843739
版权声明:本文为博主原创文章,转载请附上博文链接!
网友评论