Windows下如何快速的安装Python模块

Windows下如何快速的安装Python模块

1、Windows下,pip安装时ReadTimeoutError解决办法

     一般情况下PIP出现ReadTimeoutError都是因为被GFW给墙了,所以一般遇到这种问题,我们可以选择国内的镜像来解决问题。在Windows下                C:\Users\Administrator\下新建pip文件夹,在创建pip.ini文件,拷贝下面代码进去,保存。

[global]
 index-url = https://pypi.tuna.tsinghua.edu.cn/simple

2、Python pip更换国内源

转载:https://blog.csdn.net/qq_30754565/article/details/82777253

pip国内的一些镜像

  阿里云 http://mirrors.aliyun.com/pypi/simple/ 
  中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/ 
  豆瓣(douban) http://pypi.douban.com/simple/ 
  清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/ 
  中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/

修改源方法:

临时使用: 
可以在使用pip的时候在后面加上-i参数,指定pip源 

pip install scrapy -i https://pypi.tuna.tsinghua.edu.cn/simple

永久修改: 
linux: 
修改 ~/.pip/pip.conf (没有就创建一个), 内容如下:

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple

windows: 
直接在user目录中创建一个pip目录,如:C:\Users\xx\pip,新建文件pip.ini,内容如下

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
  • 发表于 2019-06-01 15:09
  • 阅读 ( 2099 )
  • 分类:python

0 条评论

请先 登录 后评论
不一样
不一样

学生

6 篇文章

作家榜 »

  1. omicsgene 691 文章
  2. 安生水 340 文章
  3. Daitoue 167 文章
  4. 生物女学霸 120 文章
  5. 红橙子 78 文章
  6. xun 76 文章
  7. rzx 74 文章
  8. CORNERSTONE 72 文章