是否可以在pip.conf
中将环境变量作为索引URL的一部分?
我尝试使用$
和${}
,但无法解析变量
最佳答案
您可以使用set environment variables for pip代替在pip.conf
文件中指定它们。
使用export PIP_DEFAULT_INDEX_URL='some_url.com'
进行设置。
要列出所有配置,请使用pip config list
。应该设置它们。
但是要小心config precedence:
--host=foo
overridesPIP_HOST=foo
PIP_HOST=foo
overrides a config file with[global] host = foo
A command specific section in the config file []
host = bar
overrides the option with same name in the [global] config file section
关于使用环境变量的Pip.conf文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57680070/