简体   繁体   English

anaconda pip 不使用 .pypirc

[英]anaconda pip doesn't use .pypirc

I'm not able to install a python package that's present in a private Azure DevOps artifact feed.我无法安装私有 Azure DevOps 工件源中存在的 python 包。 I've added the feed as an extra index-server in my (windows) profile directory's .pypirc file but that doesn't seem to help.我在我的(windows)配置文件目录的.pypirc文件中添加了提要作为额外的索引服务器,但这似乎没有帮助。 I'm sure the contents of that file is correct (read below), so what's the problem?我确定该文件的内容是正确的(请阅读下文),那么有什么问题呢?

I have a python Azure Function project in VSCode.我在 VSCode 中有一个 python Azure Function 项目。 VSCode created a .venv directory. VSCode 创建了一个 .venv 目录。 It contains python.exe and pip.exe in its Scripts subdirectory.它在其 Scripts 子目录中包含 python.exe 和 pip.exe。 When I open a cmd prompt, go to that directory and perform my pip install <my private wheel> , it works just fine!当我打开 cmd 提示符时,转到该目录并执行我的pip install <my private wheel> ,它工作得很好! That pip does pick up .pypirc which then also must have the correct content.该 pip 确实拾取了.pypirc ,然后它也必须具有正确的内容。

Why doesn't the C:\\tools\\Anaconda3\\envs\\scipytest\\Scripts\\pip.exe pick up the .pypirc file?为什么C:\\tools\\Anaconda3\\envs\\scipytest\\Scripts\\pip.exe不提取 .pypirc 文件? Note that this pip is able to do it when I using the --extra-index-url parameter.请注意,当我使用--extra-index-url参数时,这个 pip 能够做到这一点。

pip doesn't read .pypirc -- whatever success you had must have had some other explanation than that pip 不读取.pypirc - 无论您取得了何种成功,都必须有其他解释

here's a summary of the files pip uses这是pip 使用的文件摘要

for windows in particular it'll look at these directories:特别是对于 Windows,它会查看这些目录:

  • user level: %APPDATA%\\pip\\pip.ini用户级别: %APPDATA%\\pip\\pip.ini
  • virtualenv level: %VIRTUAL_ENV%\\pip.ini virtualenv 级别:%VIRTUAL_ENV%\\pip.ini
  • global: C:\\ProgramData\\pip\\pip.ini全局: C:\\ProgramData\\pip\\pip.ini
  • or if PIP_CONFIG_FILE is set it will respect that或者如果PIP_CONFIG_FILE被设置,它将尊重

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM