如何升级到python3版本并且安装pip3及ipython3
答案:1 悬赏:70 手机版
解决时间 2021-03-24 00:11
- 提问者网友:原来太熟悉了会陌生
- 2021-03-23 20:45
如何升级到python3版本并且安装pip3及ipython3
最佳答案
- 五星知识达人网友:怙棘
- 2021-03-23 22:05
如何升级到python3版本并且安装pip3
准备:
Python-3.5.2.tar.xz
pip-8.1.2.tar.gz
setuptools-24.0.2.zip
步骤:
1、自定义编译安装python3.x版本
[html] view plain copy
tar Jxf Python-3.5.2.tar.xz
cd Python-3.5.2
./configure --prefix=/usr/local/Python3
make && make install
2、安装pip3.x,安装会提示需要setuptools模块,所以需要先安装setuptools模块
[objc] view plain copy
tar zxf pip-8.1.2.tar.gz
tar zxf setuptools-24.0.2.zip
cd setuptools-24.0.2
ln -s /usr/local/Python/bin/python3 /usr/bin/python3
python3 setup.py install
cd ..
cd pip-8.1.2
python3 setup.py install
ln -s /usr/local/Python3/bin/pip3 /usr/bin/pip3
3、验证模块是否正常安装
[html] view plain copy
python3 -m pip list
decorator (4.0.10)
ipython (4.2.1)
ipython-genutils (0.1.0)
pexpect (4.2.0)
pickleshare (0.7.2)
pip (8.1.2)
ptyprocess (0.5.1)
setuptools (24.0.2)
simplegeneric (0.8.1)
traitlets (4.2.2)
4、安装ipython
[html] view plain copy
python3 -m pip install ipython
ln -s /usr/local/Python3/bin/ipython3 /usr/bin/ipython3
5、遇到的问题
a、安装pip3的时候提示没有zlib模块
[html] view plain copy
yum install -y zlib-devel
./configure; echo $? ; make && make install
b、使用pip3的时候提示没有HTTPSHandler模块,提示信息如下,
ImportError: cannot import name 'HTTPSHandler
[html] view plain copy
yum install -y openssl-devel
然后再重新编译安装python3就可以了,安装完成后就可以直接使用pip3了,不需要再重新编译安装pip3
准备:
Python-3.5.2.tar.xz
pip-8.1.2.tar.gz
setuptools-24.0.2.zip
步骤:
1、自定义编译安装python3.x版本
[html] view plain copy
tar Jxf Python-3.5.2.tar.xz
cd Python-3.5.2
./configure --prefix=/usr/local/Python3
make && make install
2、安装pip3.x,安装会提示需要setuptools模块,所以需要先安装setuptools模块
[objc] view plain copy
tar zxf pip-8.1.2.tar.gz
tar zxf setuptools-24.0.2.zip
cd setuptools-24.0.2
ln -s /usr/local/Python/bin/python3 /usr/bin/python3
python3 setup.py install
cd ..
cd pip-8.1.2
python3 setup.py install
ln -s /usr/local/Python3/bin/pip3 /usr/bin/pip3
3、验证模块是否正常安装
[html] view plain copy
python3 -m pip list
decorator (4.0.10)
ipython (4.2.1)
ipython-genutils (0.1.0)
pexpect (4.2.0)
pickleshare (0.7.2)
pip (8.1.2)
ptyprocess (0.5.1)
setuptools (24.0.2)
simplegeneric (0.8.1)
traitlets (4.2.2)
4、安装ipython
[html] view plain copy
python3 -m pip install ipython
ln -s /usr/local/Python3/bin/ipython3 /usr/bin/ipython3
5、遇到的问题
a、安装pip3的时候提示没有zlib模块
[html] view plain copy
yum install -y zlib-devel
./configure; echo $? ; make && make install
b、使用pip3的时候提示没有HTTPSHandler模块,提示信息如下,
ImportError: cannot import name 'HTTPSHandler
[html] view plain copy
yum install -y openssl-devel
然后再重新编译安装python3就可以了,安装完成后就可以直接使用pip3了,不需要再重新编译安装pip3
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯