手抄报 安全手抄报 手抄报内容 手抄报图片 英语手抄报 清明节手抄报 节约用水手抄报

pip如何配置pip config

时间:2024-10-13 21:47:53

1、首先判断你的平台Linux/Window/Mac OS

2、可以在多个路径下找到pip.conf,没有则创建,另外,还可以通过环境变量PIP_CONFIG_FILE来指定配置文件的路径。Linux:/etc/pip.conf~/.pip/pip.conf~/.config/pip/pip.confWindows:%APPDATA%\pip\pip.ini%HOME%\pip\pip.iniC:\Documents and Settings\All Users\Application Data\PyPA\pip\pip.conf (Windows XP)C:\ProgramData\PyPA\pip\pip.conf (Windows 7及以后)Mac OSX:~/Library/Application Support/pip/pip.conf~/.pip/pip.conf/Library/Application Support/pip/pip.conf

3、类型一:只要pip命令中出现的选项都可以配置在配置文件中(输入pip命令查看选型),这些选项都可以写在配置文件中。[global]index-url = http://pypi.douban.com/simple #豆瓣源,可以换成其他的源extra-index-url = https://pypi.tuna.tsinghua.edu.cn/simpletrusted-host = pypi.tuna.tsinghua #清华timeout = 120

4、类型二:pip支持install、download、uninstall、freeze、list、show、search、wheel、hash、completion等多条子命令,这些都可以分别配置。以pip install为例输入命令pip help install,就会提示pip install支持的所有选项,在配置文件中,就要部署在install选项下,示例如下:[install]ignore-installed = trueno-dependencies = yes

© 手抄报圈