gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 19:05:08 25 4
gpt4 key购买 nike

我尝试下载这个包:

echo --extra-index-url https://google-coral.github.io/py-repo/ pycoral~=2.0 >requirements.txt
cat /root/requirements.txt
这是输出:
--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
这是输出:
/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无法按预期下载包。如何下载 requirements.txt为此 non github package ?

最佳答案

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

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

pycoral~=2.0
requirements.txt文件格式规范, --extra-index-url option 被认为是“全局选项”,必须在自己的行上隔离:

The following options have an effect on the entire pip install run, and must be specified on their individual lines.

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

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

关于python - --extra-index-url 在 python requirements.txt 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72025164/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com