我嘗試下載這個包:
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?
uj5u.com熱心網友回復:
requirements.txt應該看起來像這樣:
--extra-index-url https://google-coral.github.io/py-repo/
pycoral~=2.0
在requirements.txt檔案格式規范中,該--extra-index-url選項被認為是“全域選項”,并且必須在其自己的行中隔離:
以下選項會對整個 pip install 運行產生影響,并且必須在其單獨的行中指定。
- --extra-index-url
- [...]
-- https://pip.pypa.io/en/stable/reference/requirements-file-format/#global-options
uj5u.com熱心網友回復:
你為什么要這樣做?
我只需下載輪子并安裝它:
wget https://github.com/google-coral/pycoral/releases/download/v2.0.0/pycoral-2.0.0-cp39-cp39-linux_x86_64.whl
pip3 install pycoral-2*.wheel
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/468550.html
