在Pycharm中解决pip安装interpreter报错,如果此存储库可通过H
在Pycharm中解决pip安装interpreter报错,如果此存储库可通过H
在使用pip 安装第三方模块的时候,报错:
WARNING: The repository located at mirrors.aliyun.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 mirrors.aliyun.com".
翻译成中文大意为:
警告:存储库位于阿里云镜像不是受信任或安全的主机,正在被忽略。如果此存储库可通过HTTPS访问,我们建议您改用HTTPS,否则您可以忽视告警并使用"-trusted-host mirrors.aliyun.com"。
遇到这种情况可以使用 pip -v config list 命令先检查下配置:
(venv) PS D:\pythonProject\MyTools> pip -v config list
For variant 'global', will try loading 'C:\ProgramData\pip\pip.ini'
For variant 'user', will try loading 'C:\Users\Administrator\pip\pip.ini'
For variant 'user', will try loading 'C:\Users\Administrator\AppData\Roaming\pip\pip.ini'
For variant 'site', will try loading 'D:\pythonProject\MyTools\venv\pip.ini'
从返回信息可以看到有四条信息,我们建议在最后一条信息的环境(虚拟环境)下编辑或者添加一个pip.ini文件。
添加的内容为:
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com
然后保存为pip.ini文件,最后再 pip -v config list 确认下结果,我们可以看到结果为:
此刻再安装第三方模块就可以正常使用了。
相关内容
- 解决使用mitmprox抓包可以访问网页,但是使用python req
- 如何忽略 Python 中异常的报错,然而,并非所有的异常
- pyCharm最新激活码破解激活教程,适用于最新的几个版本
- Pycharm的安装和使用,下载完成后双击运行。
- 简洁好用的python-pip包更新工具,该工具目前还提供了
- 使用python311+pycharm社区版+MySQL80,使用django连接MySQL,
- pip下载离线包和离线包安装,
- 使用pycharm进行绘图,图片无法显示的解决,
- pyecharts中frompyechartsimportoptionsasopts报错问题以及解决办
- pycharm没有找到manage repositories按钮的解决办法,
评论关闭