After python changes the source, pip will report an error——com is not a trusted or secure host and is being ignored

After python changes the source, pip will report an error

The repository located at mirrors.aliyun.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 silence this warning and allow it anyway with '--trusted-host mirrors.aliyun.com'.
  Could not find a version that satisfies the requirement virtualenv (from versions: )
No matching distribution found for virtualenv

The repository located at mirrors.aliyun.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 silence this warning and allow it anyway with '--trusted-host mirrors.aliyun.com'.

The reason is that domestic source websites are not trusted.

The solution is to add --trusted-host mirrors.aliyun.com after pip install <package> (see here what domestic source you added)

pip install virtualenv --trusted-host mirrors.aliyun.com

 

Guess you like

Origin blog.csdn.net/bulletstart/article/details/131054835