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'.”安装错误问题:


pip install命令安装扩展库整理

解决办法:

(1)可以使用参数–trusted-host指定可信任的主机
pip install -i http://pypi.douban.com/simple django --trusted-host=pypi.douban.com


pip install命令安装扩展库整理

安装成功后,可以用pip list查看包列表验证一下。


pip install命令安装扩展库整理

(2)不用参数–trusted-host,把http换成https。
pip install -i https://pypi.douban.com/simple django

试一下,先删除已安装的django包
pip uninstall django


pip install命令安装扩展库整理
pip install命令安装扩展库整理

安装成功。

来源:https://blog.csdn.net/qq_40078436/article/details/114238908

标签:python,pip
0
投稿

猜你喜欢

  • 对python列表里的字典元素去重方法详解

    2023-09-20 13:45:47
  • 面向对象设计过程中必须遵守的相关准则

    2009-01-08 15:52:00
  • PHP的PDO错误与错误处理

    2023-06-05 20:21:40
  • jQuery+php简单实现全选删除的方法

    2023-11-05 20:23:38
  • 详解Python中表达式i += x与i = i + x是否等价

    2023-07-29 06:51:12
  • 将多宿主计算机配置为SQL Server访问

    2011-01-04 16:17:00
  • PHP addAttribute()函数讲解

    2023-06-06 09:03:45
  • css可以给img元素设置背景图

    2008-09-29 15:35:00
  • 手把手教你安装Windows版本的Tensorflow

    2021-07-12 07:03:15
  • Python入门教程之Python的安装下载配置

    2021-08-18 06:01:14
  • Python计算双重差分模型DID及其对应P值使用详解

    2022-08-06 21:07:53
  • Python heapq使用详解及实例代码

    2023-03-07 14:36:56
  • asp中判断是否是手机浏览器以及手机类型

    2014-12-06 09:33:05
  • python3爬取淘宝信息代码分析

    2021-05-03 04:59:11
  • python ip正则式

    2022-02-13 22:13:02
  • python基于openpyxl生成excel文件

    2022-08-03 03:10:47
  • 用Python编写一个每天都在系统下新建一个文件夹的脚本

    2021-11-08 22:39:16
  • Python使用lxml模块和Requests模块抓取HTML页面的教程

    2021-08-29 20:55:33
  • Python基于Tkinter模块实现的弹球小游戏

    2022-11-25 15:32:16
  • 在Pycharm中使用GitHub的方法步骤

    2021-04-27 04:46:48
  • asp之家 网络编程 m.aspxhome.com