关于python:pip,如何删除无效索引的基本URL

pip, how to remove dead index base url

当我尝试使用pip安装软件包时,它首先尝试从不再存在的URL中获取,从而导致以下错误

1
Cannot fetch index base URL http://xyz.xxx:8080/simple/

但是它继续从pypi下载并安装软件包。我想摆脱这个索引基本URL,我不想每次都看到此消息。我不记得我是如何添加此URL的,但是在某些时候它是一个有效的私有软件包索引。我已经摆脱了/ etc / hosts文件中的url,但是pip仍然尝试从该位置获取软件包。


似乎在其中添加了URL的pip配置文件。引用文档:

The names and locations of the configuration files vary slightly
across platforms.

On Unix and Mac OS X the configuration file is: $HOME/.pip/pip.conf

On Windows, the configuration file is: %HOME%\\pip\\pip.ini