pip download fails to download the package prompt No matching distribution found XXX

Obviously it pip install <package_names>is normal to pass, but pip download <package_names>sometimes it promptsNo matching distribution found for <package_names>

At the same time, the terminal prompts the content:

WARNING: The repository located at pypi.douban.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silenc

e this warning and allow it anyway with '--trusted-host pypi.douban.com'.

ERROR: Could not find a version that satisfies the requirement  <package_names> (from versions: none)

ERROR: No matching distribution found for  <package_names>

Cause 1:

The configuration pip源is not a trusted host, so the source is ignored when downloading

Solution:

After executing the command --trusted-host <pip源地址>, you can download normally, such as:

pip dwonload pytest -d pack --trusted-host mirrors.aliyun.com

ps: --trusted-host pypi.douban.com This is to obtain the authentication of the ssl certificate

Common pip mirror source (domestic source)
Tsinghua University: https://pypi.tuna.tsinghua.edu.cn/simple
Alibaba Cloud: http://mirrors.aliyun.com/pypi/simple/
University of Science and Technology of China https://pypi .mirrors.ustc.edu.cn/simple/
Huazhong University of Science and Technology: http://pypi.hustunique.com/Shandong
University of Technology: http://pypi.sdutlinux.org/Douban
: http://pypi.douban.com /simple/

Reason two:

No matching binary package provided

Solution:

Install with non-binary packages --no-binary=:all: <package_name>

pip download --no-binary=:all: tornado==6.0 -d pkg/

Reason three:

The version of pip is too low, you need to upgrade it, you can execute the following command to try

Solution:

update pip version

 python -m pip install --upgrade pip

Reason four:

Check whether the proxy or VPN is enabled, turn it off and use the domestic mirror to try to see if it can be solved. My side is that the proxy is turned on and the network is too slow and an error is reported.

Solution:

close vpn

Guess you like

Origin blog.csdn.net/qq_43961619/article/details/129729219