Windows7 设置pip 镜像 Pip Warning:–trusted-host 问题解决方案

简介: 最近写了一篇关于“微软开源分布式高性能GB框架LightGBM安装使用”的文章,有小伙伴安装Python环境遇到了问题。我个人也尝试安装了一下,确实遇到了很多问题。这不又遇到;设置pip 镜像 Pip Warning:–trusted-host 问题。

最近写了一篇关于“微软开源分布式高性能GB框架LightGBM安装使用”的文章,有小伙伴安装Python环境遇到了问题。我个人也尝试安装了一下,确实遇到了很多问题。这不又遇到;设置pip 镜像 Pip Warning:–trusted-host 问题。

pip升级到7.0以后,在使用http镜像进行包安装及升级的时候往往会有如下提示:

Collecting beautifulsoup4
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 it is recommended to use HTTPS instead, otherwise you may silence this warning and allow it anyways with ‘–trusted-host mirrors.aliyun.com’.
Could not find a version that satisfies the requirement beautifulsoup4 (from versions: )
No matching distribution found for beautifulsoup4
解决办法如下:
1.安装时加入“--trusted-host=mirrors.aliyun.com”参数:
pip install beautifulsoup4 --trusted-host=mirrors.aliyun.com
2.在pip.ini中加入trusted-host选项,该方法是一劳永逸
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com

"pip.ini"文件在哪?

请参考:Python pip 国内镜像大全及使用办法

======================文档信息======================
版权声明:非商用自由转载-保持署名-注明出处
署名(BY) :testcs_dn(微wx笑)
文章出处:[无知人生,记录点滴](http://blog.csdn.net/testcs_dn)

目录
相关文章
|
2月前
|
安全 Windows
安装MyEclipse遇到错误提示 Failed to find a Main Class in “C:Windows\Temp\“时的解决方案
安装MyEclipse遇到错误提示 Failed to find a Main Class in “C:Windows\Temp\“时的解决方案
53 1
|
2月前
|
Java Windows
windows下 安装 Elasticsearch报错warning: usage of JAVA_HOME is deprecated, use ES_JAVA_HOME
windows下 安装 Elasticsearch报错warning: usage of JAVA_HOME is deprecated, use ES_JAVA_HOME
239 0
|
15天前
|
Windows
【Windows】 Win10下报错:该文件没有与之关联的应用来执行该操作。请安装应用,若已经安装应用,请在“默认应用设置”页面中创建关联
【Windows】 Win10下报错:该文件没有与之关联的应用来执行该操作。请安装应用,若已经安装应用,请在“默认应用设置”页面中创建关联
124 1
|
1月前
|
网络虚拟化 Windows
Windows 10 Windows1011出现0x80190001错误解决方案! Windows微软账户无法登录问题 Microsoft Store商店用不了
Windows 10 Windows1011出现0x80190001错误解决方案! Windows微软账户无法登录问题 Microsoft Store商店用不了
26 1
|
1月前
|
Python Windows
在 Windows 平台下打包 Python 多进程代码为 exe 文件的问题及解决方案
在使用 Python 进行多进程编程时,在 Windows 平台下可能会出现将代码打包为 exe 文件后无法正常运行的问题。这个问题主要是由于在 Windows 下创建新的进程需要复制父进程的内存空间,而 Python 多进程机制需要先完成父进程的初始化阶段后才能启动子进程,所以在这个过程中可能会出现错误。此外,由于没有显式导入 Python 解释器,也会导致 Python 解释器无法正常工作。为了解决这个问题,我们可以使用函数。
33 5
|
19天前
|
Shell Linux 网络安全
【Python】已完美解决:(pip提示升级)WARNING: There was an error checking the latest version of pip.,
【Python】已完美解决:(pip提示升级)WARNING: There was an error checking the latest version of pip.,
27 0
|
21天前
|
NoSQL Redis Windows
Windows设置Redis服务使其开机自启
Windows设置Redis服务使其开机自启
30 0
|
1月前
|
Windows
windows系统bat批处理 网络设置大全 设置静态、动态IP地址
windows系统bat批处理 网络设置大全 设置静态、动态IP地址
53 2
|
28天前
|
Python Windows
windows下更改pip版本
在CMD中运行`pip -V`检查pip与Python的关联版本。通过系统设置>环境变量>Path,修改包含Python和Scripts目录的路径为实际安装路径。完成后,验证`pip -V`显示的Python版本已更新。
|
1月前
|
应用服务中间件 Windows
Windows下CMD和Tomcat设置编码为UTF-8
解决CMD和Tomcat中文乱码问题:通过修改注册表永久设置CMD编码为UTF-8,路径 `\HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cmd.exe`,修改CodePage为65001。Tomcat日志乱码时,在 `\HKEY_CURRENT_USER\Console` 下新建Tomcat项,添加DWORD值PageCode,值设为65001。