pip install命令安装扩展库整理
作者:linda公馆 时间:2021-10-13 21:49:14
pip install命令用于安装扩展库,由于安装扩展库需要从国外网站下载,速度较慢,可以使用-i选项设置临时使用国内的镜像网站。
命令格式:
pip install -i 镜像地址 包名
例如:pip install -i http://pypi.douban.com/simple/ django
常用国内镜像地址:
清华大学:https://pypi.tuna.tsinghua.edu.cn/simple/
阿里云:https://mirrors.aliyun.com/pypi/simple/
豆瓣网:https://pypi.douban.com/simple/
中国科技大学:https://pypi.mirrors.ustc.edu.cn/simple/
使用pip install命令时,如果出现“WARNING: The repository located at pypi.douban.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it anyway with ‘–trusted-host pypi.douban.com'.”安装错误问题:
解决办法:
(1)可以使用参数–trusted-host指定可信任的主机
pip install -i http://pypi.douban.com/simple django --trusted-host=pypi.douban.com
安装成功后,可以用pip list查看包列表验证一下。
(2)不用参数–trusted-host,把http换成https。pip install -i https://pypi.douban.com/simple django
试一下,先删除已安装的django包pip uninstall django
安装成功。
来源:https://blog.csdn.net/qq_40078436/article/details/114238908
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
对python列表里的字典元素去重方法详解
面向对象设计过程中必须遵守的相关准则
PHP的PDO错误与错误处理
jQuery+php简单实现全选删除的方法
详解Python中表达式i += x与i = i + x是否等价
![](https://img.aspxhome.com/file/2023/4/78634_0s.png)
将多宿主计算机配置为SQL Server访问
PHP addAttribute()函数讲解
![](https://img.aspxhome.com/file/2023/2/55412_0s.png)
css可以给img元素设置背景图
手把手教你安装Windows版本的Tensorflow
![](https://img.aspxhome.com/file/2023/6/84066_0s.png)
Python入门教程之Python的安装下载配置
![](https://img.aspxhome.com/file/2023/7/86597_0s.png)
Python计算双重差分模型DID及其对应P值使用详解
![](https://img.aspxhome.com/file/2023/5/68335_0s.jpg)
Python heapq使用详解及实例代码
asp中判断是否是手机浏览器以及手机类型
python3爬取淘宝信息代码分析
python ip正则式
python基于openpyxl生成excel文件
![](https://img.aspxhome.com/file/2023/4/82684_0s.png)
用Python编写一个每天都在系统下新建一个文件夹的脚本
Python使用lxml模块和Requests模块抓取HTML页面的教程
Python基于Tkinter模块实现的弹球小游戏
![](https://img.aspxhome.com/file/2023/4/94114_0s.png)
在Pycharm中使用GitHub的方法步骤
![](https://img.aspxhome.com/file/2023/4/83654_0s.png)