Linux 安装python3 .5 解决pip 安装无法成功问题ssl安全阻拦

pip is configured with locations that require TLS/SSL, 
however the ssl module in Python is not available.
Could not fetch URL https://pypi.org/simple/pip/: 
There was a problem confirming the ssl certificate: 
HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with  
 url: /simple/pip/ 
(Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping



在~/.pip/pip.conf文件中添加或修改

在root目录下新建.pip目录,

cd root 

mkdir .pip

cd .pip

touch pip.conf

vi pip.conf

[global]
index-url = http://mirrors.aliyun.com/pypi/simple/  #可以手工指定是http的或者https的 

[install]
trusted-host=mirrors.aliyun.com

pip3 install requests

Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Collecting requests
  Downloading http://mirrors.aliyun.com/pypi/packages/7d/e3/20f3d364d6c8e5d2353c72a67778eb189176f08e873c9900e10c0287b84b/requests-2.21.0-py2.py3-none-any.whl (57kB)
    100% |████████████████████████████████| 61kB 695kB/s 
Collecting urllib3<1.25,>=1.21.1 (from requests)
  Downloading http://mirrors.aliyun.com/pypi/packages/62/00/ee1d7de624db8ba7090d1226aebefab96a2c71cd5cfa7629d6ad3f61b79e/urllib3-1.24.1-py2.py3-none-any.whl (118kB)
    100% |████████████████████████████████| 122kB 1.3MB/s 
Collecting idna<2.9,>=2.5 (from requests)
  Downloading http://mirrors.aliyun.com/pypi/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl (58kB)
    100% |████████████████████████████████| 61kB 1.7MB/s 
Collecting certifi>=2017.4.17 (from requests)
  Downloading http://mirrors.aliyun.com/pypi/packages/9f/e0/accfc1b56b57e9750eba272e24c4dddeac86852c2bebd1236674d7887e8a/certifi-2018.11.29-py2.py3-none-any.whl (154kB)
    100% |████████████████████████████████| 163kB 2.3MB/s 
Collecting chardet<3.1.0,>=3.0.2 (from requests)
  Downloading http://mirrors.aliyun.com/pypi/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
    100% |████████████████████████████████| 143kB 1.3MB/s 
Installing collected packages: urllib3, idna, certifi, chardet, requests
Successfully installed certifi-2018.11.29 chardet-3.0.4 idna-2.8 requests-2.21.0 urllib3-1.24.1




 

你可能感兴趣的:(python基础,自动化测试)