在python使用pip安装新的模块时候,经常出现如下图所示安装速度非常缓慢的情形:
如上所示,几兆的文件经常需要花费很长的时间。
官方文档中给出了提示:
On Unix the default configuration file is: $HOME/.config/pip/pip.conf which respects the XDG_CONFIG_HOME environment variable.
On macOS the configuration file is $HOME/Library/Application Support/pip/pip.conf if directory $HOME/Library/Application Support/pip exists else $HOME/.config/pip/pip.conf.
On Windows the configuration file is %APPDATA%\pip\pip.ini
根据文档看出,python安装模块时候会默认到%APPDATA%\pip\pip.ini下进行查找安装源。
windows下配置:
(1)我们在浏览器地址栏输入%APPDATA%进入对应地址,在此路径下新建一个pip文件夹。
(2&#x