Skip to main content
 首页 » 编程设计

python之.pip 文件夹不在 OSX 上的 HOME 目录中

2025年05月04日17jillzhang

我正在尝试编辑 ~/.pip/pip.conf 文件,但 .pip 文件夹在 osx 中不存在。

我在全局范围内安装了 pip,并在各种虚拟环境中使用它。

我需要手动创建这个文件夹和文件吗?

请您参考如下方法:

添加到这里,因为最近的 pip 错误困扰着我,我希望在全局范围内设置它

DEPRECATION: The default format will switch to columns in the future.  
You can use --format=(legacy|columns)  
(or define a format=(legacy|columns)  
in your pip.conf under the [list] section) to disable this warning. 

我最终在我的 $HOME 目录下创建了一个带有 pip.conf 文件的 .pip 目录以供全局使用:

cd $HOME 
mkdir .pip 
cd .pip 
touch pip.conf 

希望这能帮助任何试图找出他们的全局 pip 在 OSX 上寻找配置文件的位置