pip-安装以及修改为国内镜像源

mkdir ~/.pip 
vim ~/.pip/pip.conf
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host = mirrors.aliyun.com 

找不到.pip在任意目录下自己创建

注意事项:

  1. http://mirrors.aliyun.com/pypi/simple/中的simple目录必须有。
  2. --no-cache-dir重新下载安装包,而不是使用缓存包。
  3. trusted-host = mirrors.aliyun.com一定要加上这行,否则会报错。

pip国内镜像源。

阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣 http://pypi.douban.com/simple
Python官方 https://pypi.python.org/simple/
v2ex http://pypi.v2ex.com/simple/
中国科学院 http://pypi.mirrors.opencas.cn/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/

安装pip 
打开这个链接 
https://pypi.org/project/pip/#files 

解压完成,进入文件夹,运行命令

python3.7    setup.py   install  
pip3.7  list
使用pip3.7,查看安装的包

  

关于报错:

URL because the SSL module is not available.")': /simple/requests/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/requests/

发现是url的来源的问题,换成了国内的pip源就可以正常安装了,我使用的是:pip install xlrd -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

I can feel you forgetting me。。 有一种默契叫做我不理你,你就不理我

原文地址:https://www.cnblogs.com/weidaijie/p/11056642.html