anaconda--配置pip


1、在合適的系統尋找合適的環境配置文件。不存在的話需要自己新建一個。

Configuration

Config file

pip allows you to set all command line option defaults in a standard inistyle config file.

The names and locations of the configuration files vary slightly acrossplatforms. You may have per-user, per-virtualenv or site-wide (shared amongstall users) configuration:

Per-user:

  • On Unix the default configuration file is: $HOME/.config/pip/pip.confwhich respects the XDG_CONFIG_HOME environment variable.
  • On macOS the configuration file is$HOME/Library/ApplicationSupport/pip/pip.conf.
  • On Windows the configuration file is %APPDATA%\pip\pip.ini.

There are also a legacy per-user configuration file which is also respected,these are located at:

  • On Unix and macOS the configuration file is: $HOME/.pip/pip.conf
  • On Windows the configuration file is: %HOME%\pip\pip.ini

You can set a custom path location for this config file using the environmentvariablePIP_CONFIG_FILE.


2、使用以下配置項

[global]
index-url=https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host=mirrors.aliyun.com


3、重啓pip。成功加速安裝。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章