linux下python3安装pip_linux上安装python3和pip----最简单的安装

安装python3和pip3:

##安装python3简明步骤

下载python3

# wget -O /opt/Python-3.6.5.tar.xz https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tar.xz

# tar xf /opt/Python-3.6.5.tar.xz -C /opt/

# cd /opt/Python-3.6.5

安装python3

# ./configure --prefix=/usr/local/python3.6

# make && make install

创建软连接

# ln -s /usr/local/python3.6/bin/python3.6 /usr/bin/python3

检测

# python3

注意:其实安装python3的时候,也顺带把pip一起给安装了。

创建pip的软连接

#ln -s /usr/local/python3.6/bin/pip3.6 /usr/bin/pip3

正常的话是,上面python3就安装好了,但是我的偏偏不正常,报错:ModuleNotFoundError: No module named 'readline'

如图:

linux下python3安装pip_linux上安装python3和pip----最简单的安装_第1张图片

此时如何解决?只需

pip3 install readline

这就真正安装好了,如图:

4eabbd34b9291238fe8191a907475c0c.png

你可能感兴趣的:(linux下python3安装pip_linux上安装python3和pip----最简单的安装)