繁体   English   中英

--extra-index-url 在 python requirements.txt 中不起作用

[英]--extra-index-url not work in python requirements.txt

我尝试下载这个 package:

echo --extra-index-url https://google-coral.github.io/py-repo/ pycoral~=2.0 >requirements.txt
cat /root/requirements.txt

这是 output:

--extra-index-url https://google-coral.github.io/py-repo/ pycoral~=2.0

然后下载:

mkdir -p /tmp/test
pip3 download --requirement /root/requirements.txt --dest /tmp/test

这是 output:

/usr/lib/python3/dist-packages/secretstorage/dhcrypto.py:15: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead
  from cryptography.utils import int_from_bytes
/usr/lib/python3/dist-packages/secretstorage/util.py:19: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead
  from cryptography.utils import int_from_bytes
Looking in indexes: https://pypi.org/simple, https://google-coral.github.io/py-repo/

然后列出目录:

ls -alith /tmp/test

total 8.0K
57409537 drwxrwxrwt 22 root root 4.0K Apr 27 15:48 ..
57409566 drwxr-xr-x  2 root root 4.0K Apr 27 15:48 .

pip3无法按预期下载 package。 如何为这个non github package下载requirements.txt

requirements.txt应该看起来像这样:

--extra-index-url https://google-coral.github.io/py-repo/

pycoral~=2.0

requirements.txt文件格式规范中, --extra-index-url选项被认为是一个“全局选项”,必须单独放在一行中:

以下选项对整个 pip 安装运行有影响,并且必须在它们各自的行上指定。

  • --extra-index-url
  • [...]

-- https://pip.pypa.io/en/stable/reference/requirements-file-format/#global-options

暂无
暂无

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

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