使用 private repo/server 从 PIP 安装包时
While installing package from PIP it using private repo/server
当我使用 pip 安装软件包时,它是从我的私有而不是 public/official 存储库安装的...如何修复?
编辑:
(test) mymac@pc137 ~/workspace pip install pacman
Collecting pacman
User for devpi.packageserver.com:
pip好像已经使用了devpi...如何关闭devpi?我不想在使用 pip 安装软件包时使用它...
额外的服务器使用可以保存在配置文件 pip.conf
中(或 pip.ini
on Windows)。由于您说您使用的是 MacOS,看来您找到了正确的位置(根据 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:
Per-user:
...
On macOS the configuration file is $HOME/Library/Application Support/pip/pip.conf
if directory $HOME/Library/Application Support/pip
exists else $HOME/.config/pip/pip.conf
.
There are also a legacy per-user configuration file which is also respected, these are located at:
On Unix and macOS the configuration file is: $HOME/.pip/pip.conf
找到配置文件,用编辑器打开它并注释掉(或删除)设置 index-url
/extra-index-url
选项的行。
当我使用 pip 安装软件包时,它是从我的私有而不是 public/official 存储库安装的...如何修复?
编辑:
(test) mymac@pc137 ~/workspace pip install pacman
Collecting pacman
User for devpi.packageserver.com:
pip好像已经使用了devpi...如何关闭devpi?我不想在使用 pip 安装软件包时使用它...
额外的服务器使用可以保存在配置文件 pip.conf
中(或 pip.ini
on Windows)。由于您说您使用的是 MacOS,看来您找到了正确的位置(根据 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:
Per-user:
...
On macOS the configuration file is
$HOME/Library/Application Support/pip/pip.conf
if directory$HOME/Library/Application Support/pip
exists else$HOME/.config/pip/pip.conf
.There are also a legacy per-user configuration file which is also respected, these are located at:
On Unix and macOS the configuration file is:
$HOME/.pip/pip.conf
找到配置文件,用编辑器打开它并注释掉(或删除)设置 index-url
/extra-index-url
选项的行。