pip install timeout problem

Everyone knows that when using pip to install the library, sometimes the network status is a little bad and it will time out. The most hateful thing is that the download is almost finished, woo woo woo~~~

Let me share my experience with you
Yesterday I used pip to download a tensorflow-gpu

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow-gpu==1.13.1

This is downloaded using the mirror image given on the Internet. But every time I downloaded halfway, it timed out. Several times when I downloaded a few megabytes, it timed out. I was also drunk.

Later found a solution online

pip install --default-timeout=100 -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow-gpu==1.13.1

This sentence --default-timeout=100 sets the delay time. After the timeout, the error will not be reported directly, and it will wait for a while, and the download will be successful after adding it. Never worry about timeout anymore.
Summary: No matter you download any package, as long as you add the above code, there will be no timeout, so happy! ! ! !

Guess you like

Origin blog.csdn.net/qq_44606064/article/details/106298983