简介:本文将介绍如何在Mac系统下修改pip源,以便更方便地安装和管理Python包。
在Mac下修改pip源需要按照以下步骤进行:
mkdir ~/.pip
cd ~/.pip
touch pip.conf
sudo vim pip.conf
注意:将
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple/
[install]
trusted-host = pypi.tuna.tsinghua.edu.cn
https://pypi.tuna.tsinghua.edu.cn/simple/
替换为你想要的源地址,将pypi.tuna.tsinghua.edu.cn
替换为可信的主机名或IP地址。将
pip install <package-name>
<package-name>
替换为你想要安装的Python包名称。如果新的pip源配置正确,该命令将开始安装指定的包。