[英]--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.