Faster python pip install using mirrors

pip is a very convenient tool to install and manage python packages. However, I often experienced very slow download speeds. Sometimes I could not even connect, especially from China. The default behavior is to download packages from pypi.org. This can be changed by specifying a mirror with the option -i:

pip install <packages...> -i https://example-of-mirror.com/simple

Using a mirror that is closer to your city can increase the download speed. The following list of mirrors is suitable for China:

  • https://pypi.tuna.tsinghua.edu.cn/simple/
  • https://pypi.mirrors.ustc.edu.cn/simple/
  • http://mirrors.aliyun.com/pypi/simple/
  • http://pypi.hustunique.com/
  • http://pypi.sdutlinux.org/
  • http://pypi.douban.com/simple/

Now, enjoy decent install speeds!