一、原因
因为pip的服务器安装源在国外,基于国内糟糕的网络环境,导致网速过慢或者安装失败,使用 pip安装Python第三方模块将是一个很痛苦的过程。
二、解决办法
pip install pymysql -i URL(其他pip源)
以使用清华源安装pymysql模块为例:
命令如下:
pip install pymysql -i https://pypi.tuna.tsinghua.edu.cn/simple/
安装结果:
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/82fac6f5f3f01b774792ad53761e00dc.png)
国内其他pip源总结如下:
阿里云 http://mirrors.aliyun.com/pypi