python3 与 pip3 安装与使用

时间:2022-11-30 20:31:13

1. yum -y install openssl*  

(pip依赖ssl环境)

 

2.编译安装python3

下载地址:https://www.python.org/ftp/python/

python3 与 pip3 安装与使用python3 与 pip3 安装与使用
1 tar zxvf Python-3.5.2.tgz
2 cd Python-3.5.2
3 ./configure
4 make && make install
安装步骤

 

3.安装完成后默认就有pip3了.   4.安装完成可以装个模块试试
1 [root@localhost Python-3.5.2]# pip3 install pymysql
2 Collecting pymysql
3 Downloading PyMySQL-0.7.9-py3-none-any.whl (78kB)
4 100% |████████████████████████████████| 81kB 6.3kB/s
5 Installing collected packages: pymysql
6 Successfully installed pymysql-0.7.9
7 You are using pip version 8.1.1, however version 9.0.1 is available.
8 You should consider upgrading via the 'pip install --upgrade pip' command.

 上面提示有新版本了  可以升级.

使用它提示的命令就可以升级pip3了..

但是注意要把pip命令替换成pip3

 1 [root@localhost Python-3.5.2]# pip3 install --upgrade pip
2 Collecting pip
3 Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB)
4 100% |████████████████████████████████| 1.3MB 3.2kB/s
5 Installing collected packages: pip
6 Found existing installation: pip 8.1.1
7 Uninstalling pip-8.1.1:
8 Successfully uninstalled pip-8.1.1
9 Successfully installed pip-9.0.1
10 [root@localhost Python-3.5.2]# pip3 --version
11 pip 9.0.1 from /usr/local/lib/python3.5/site-packages (python 3.5)

升级完成

 

 

PS:

如果使用pip3安装插件的时候提示:

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. 

是因为系统缺少openssl-devel包

yum install openssl-devel -y  安装一下即可.

再按照上面的方法重新 编译一下即可.

 

如果觉得还不错..在下面顶我一下哈