How to solve the slow speed of pip3, how to solve pip3 installation failure

The installation speed of pip3 is very slow. This is because the default download URL of pip is a foreign website: https://pypi.org/simple, the download speed is relatively slow
 

You can change the pip3 download source to domestic, where xxx is the name of the package

pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple  xxx

Some blogs change the default download of pip to Tsinghua source or Douban source. This method is not very good. Some packages that will be updated in the future may not be found in domestic sources. The compromise method is to directly use the above Method to install, if it fails, choose:

pip3 install xxx 

This is the normal installation method, and the pip3 installation method is generally preferred (if it is in the python3 version).

If there are still errors, such as the package location cannot be found, or the http connection timed out, you can try again:
 

sudo apt install python3-xxx

Since the apt installation method cannot specify the package version, this method installs the software version obtained through apt update last time.

If you need to specify the package version, then you need

pip3 install xxx== serial number

If multiple packages are installed together, there will be a requirements.txt file. The installation problem that appears here may be that there is a problem with the installation of one of the multiple packages, then you can open this file, install separately, and choose different ways to troubleshoot one by one problem. 

Guess you like

Origin blog.csdn.net/sinat_39416814/article/details/107373253