简体   繁体   English

可以指定使用pip和distutils setup.py时要安装python软件包的工件吗?

[英]Possible to specify artifactory to install python packages from when using pip and distutils setup.py?

I have a python program packaged with distutils, where a number of dependencies are specified in the setup.py file under the install_requires section. 我有一个与distutils打包在一起的python程序,在install_requires部分下的setup.py文件中指定了许多依赖项。

Up until now these python packages have been sourced from the default location on the internet. 到目前为止,这些python软件包均来自Internet上的默认位置。 However, now I would like to use our internal Artifactory to source all python packages, and to throw an error if the dependency is not found in the internal Artifactory. 但是,现在,我想使用我们的内部Artifactory来获取所有python包,并且如果在内部Artifactory中未找到依赖项,则会引发错误。

Is there a configuration option or ENV variable that may be changed to force distutils to source packages from an internal artifactory? 是否可以更改配置选项或ENV变量以迫使distutils从内部工件获取软件包?

I would also like to force this requirement within certain virtual environments, such that pip will not install a package unless it can install it from the internal Artifactory 我还想在某些虚拟环境中强制执行此要求,以使pip不会安装软件包,除非可以从内部Artifactory安装它

So you basically want to configure pip to use your internal Artifactory as index-url . 因此,您基本上希望将pip配置为将内部Artifactory用作index-url

Also you can try to restrict easy_install with allow-hosts . 您也可以尝试使用allow-hosts限制easy_install

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

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