在AppEngine上部署应用程序时,我必须配置pip命令行参数,例如:
pip install requirements.txt -i host.com --version x.x等
有可能吗?
发布于 2018-10-18 16:58:27
我假设您使用的是新的Python3.7运行时,它允许您通过指定requirements.txt文件进行部署。
可以传递给pip install命令的任何参数都可以包含在每个依赖项的requirements.txt文件中(参见需求文件格式)。
因此,如果您目前有一个requirements.txt,如:
foo==1.2.3
bar==0.0.1您可以将其更新为:
foo==1.2.3 -i host.com
bar==0.0.1 -i host.com然后,在安装这些依赖项时将使用这些参数。
(顺便说一句,我不知道在您的示例中如何处理--version标志,它不会对pip install命令产生任何影响。)
https://stackoverflow.com/questions/52873326
复制相似问题