使用私有repo/s从PIP-it安装包时

2024-10-04 01:29:49 发布

您现在位置:Python中文网/ 问答频道 /正文

当我用pip安装软件包时,它从我的私有而不是公共/官方repo安装它。。。如何修复?在

编辑:

(test)  mymac@pc137  ~/workspace  pip install pacman

Collecting pacman

^{pr2}$

看来devpi已经被pip使用了。。。如何关闭devpi?我不想在安装带有pip的包时使用它。。。在


Tags: installpiptest编辑官方repopacmanworkspace
1条回答
网友
1楼 · 发布于 2024-10-04 01:29:49

额外的服务器使用可以保存在配置文件pip.conf(或者在Windows上是pip.ini)中。既然你说你在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选项的行。在

相关问题 更多 >