当我尝试使用 pip 安装包时,它首先尝试从一个不再存在的 url 中获取,这会导致以下错误
Cannot fetch index base URL http://xyz.xxx:8080/simple/
但它继续从 pypi 下载并安装包。我想摆脱这个索引基 url,我不想每次都看到这个消息。我不记得我是如何添加这个 url 但它在某个时候是一个有效的私有(private)包索引。我已经从/etc/hosts 文件中删除了 url,但 pip 仍然尝试从该位置获取包。
最佳答案
看起来有一个 pip 配置文件,您在其中添加了 URL。引自 docs :
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
关于python - pip,如何删除死索引基 url,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18880158/