pip.conf不注意受信任的主机 [英] pip.conf not paying attention to trusted-host

查看:193
本文介绍了pip.conf不注意受信任的主机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的我的pip.conf文件如下:

[global]
trusted-host = <private IP>
extra-index-url = http://<private IP>/pypi

但是,每当我尝试从私有pypi存储库安装软件包(只是测试软件包)时,都会收到一条错误消息,指示我添加--trusted-host <private IP>.如果可以,我可以成功安装该软件包,因此我知道pip正在读取pip.conf文件.为什么不遵守trusted-host配置?我已经三遍检查配置文件中的IP是否匹配.

However, whenever I try to install a package (just a test package) from the private pypi repo, I receive an error that instructs me to add --trusted-host <private IP>. If I do, I can successfully install the package, so I know that pip is reading the pip.conf file. Why isn't it respecting the trusted-host config? I've triple checked that the IPs match in the config file.

几个博客和对Google的粗略搜索似乎都建议这样做. (

Several blogs and cursory searches of Google seem to suggest that it should. (https://pseudoscripter.wordpress.com/2016/05/07/pip-the-repository-located-at-some-ip-is-not-a-trusted-or-secure-host-and-is-being-ignored/)

推荐答案

这不是不同pip.conf具有不同配置的问题吗? /en/stable/user_guide/#config-file"rel =" noreferrer>官方文档:

Couldn't this be a problem of different pip.conf having different configurations?According to the official docs:

配置文件的名称和位置在不同平台上略有不同.您可能具有按用户,按虚拟环境或站点范围(在所有用户之间共享)的配置.

The names and locations of the configuration files vary slightly across platforms. You may have per-user, per-virtualenv or site-wide (shared amongst all users) configuration.

  • 在Unix上,默认配置文件为:$ HOME/.config/pip/pip.conf ,该文件遵循 XDG_CONFIG_HOME 环境变量.
  • 还有一个按用户使用的旧版配置文件,该文件位于Unix和macOS上的 $ HOME/.pip/pip.conf 中.
  • 在virtualenv内,在Unix和macOS上,文件为 $ VIRTUAL_ENV/pip.conf
  • 站点范围内,在Unix上,该文件可能位于/etc/pip.conf 中.或者,它可以位于环境变量 XDG_CONFIG_DIRS (如果存在)中设置的任何路径的"pip"子目录中,例如/etc/xdg/pip/pip.conf .
  • On Unix the default configuration file is: $HOME/.config/pip/pip.conf which respects the XDG_CONFIG_HOME environment variable.
  • There is also a legacy per-user configuration file which is also respected, and is located at $HOME/.pip/pip.conf on Unix and macOS.
  • Inside a virtualenv, on Unix and macOS the file is $VIRTUAL_ENV/pip.conf
  • Site-wide, on Unix the file may be located in /etc/pip.conf. Alternatively it may be in a "pip" subdirectory of any of the paths set in the environment variable XDG_CONFIG_DIRS (if it exists), for example /etc/xdg/pip/pip.conf.

这篇关于pip.conf不注意受信任的主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆