使用国内镜像源来加速python pypi包的安装
2023-09-27 14:23:27 时间
默认pip是使用Python官方的源,但是由于国外官方源经常被墙,导致不可用,我们可以使用国内的python镜像源,从而解决Python安装不上库的烦恼。
1
2
3
|
网上有很多可用的源,例如: 豆瓣:http: //pypi .douban.com /simple/ 清华:https: //pypi .tuna.tsinghua.edu.cn /simple |
注意后面要有/simple目录!!!
1、临时使用,只有安装pillow时使用指定源
1
|
pip3 install -i https: //pypi .tuna.tsinghua.edu.cn /simple pillow |
2、永久修改,一劳永逸
1
2
3
4
5
6
7
|
Linux下,修改 ~/.pip /pip .conf (没有就创建一个), 修改 index-url至tuna,内容如下: [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 |
相关文章
- python:基于super()函数初始化
- python 利用 setup.py 手动安装第三方类库
- 2023最新Python 环境安装篇,教你写下第一个Python程序
- 2023最新版python安装教程
- 利用Python模拟鼠标自动完成MM32-LINK程序下载
- 在Windows下安装配置OpenCV-Python-PyCharm开发环境
- python操作mongodb
- Windows 安装Python-PCL,其中Python.3.8.3版本
- python字符串str和字节数组bytes相互转化
- Python代码库OpenCV之基础环境搭建(含代码)
- Python 代码库之读取sqlite数据库(支持分页含源码)
- python安装模块如何通过setup.py安装
- python RSA加密、解密、签名
- python django 基本测试
- Python编辑器(PyCharm)超详细安装教程
- python递归遍历查询文件 & 文件夹
- Python 系统学习梳理_【All】
- Python random() 函数,产生整数随机数,浮点数随机数