pip安装和下载第三方库

pip默认下载第三方库的网站是Python官方模块库:https://pypi.python.org。但有时网速比较慢,我们可以更换国内的镜像源。

  1. 新版ubuntu要求使用https源,要注意。

  2. 清华:https://pypi.tuna.tsinghua.edu.cn/simple

  3. 阿里云:http://mirrors.aliyun.com/pypi/simple/

  4. 中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/

  5. 华中理工大学:http://pypi.hustunique.com/

  6. 山东理工大学:http://pypi.sdutlinux.org/

  7. 豆瓣:http://pypi.douban.com/simple/

一、临时更改下载源

  1、安装:pip install 库名 -i https://pypi.tuna.tsinghua.edu.cn/simple

  2、下载:pip download 库名 -i 镜像源

二、永久更改下载源

  1、pip config set global.index-url='https://pypi.tuna.tsinghua.edu.cn/simple'

posted @ 2021-09-22 16:04  桃花落,闲池阁  阅读(1008)  评论(0编辑  收藏  举报