如何在Mac中修改pip的镜像源

一. 修改步骤

  1. 进入命令行

  2. 进入到用户根目录

    bash 复制代码
    cd ~/
  3. 在用户根目录下创建 .pip 文件夹

    bash 复制代码
    mkdir .pip
  4. 进入到 ~/.pip 文件夹内

    bash 复制代码
    cd ~/.pip
  5. 创建 pip.conf 文件

    bash 复制代码
    vim pip.conf
  6. pip.conf 文件中添加清华大学的镜像源,如下:

    bash 复制代码
    [global]
    index-url=https://pypi.tuna.tsinghua.edu.cn/simple/
    [install]
    trusted-host=pypi.tuna.tsinghua.edu.cn

二. 其他国内镜像源

相关推荐
fly-phantomWing17 小时前
在命令提示符页面中用pip命令行安装Python第三方库的详细步骤
开发语言·python·pip
@@神农18 小时前
maven的概述以及在mac安装配置
java·macos·maven
万粉变现经纪人18 小时前
如何解决 pip install 安装报错 ImportError: cannot import name ‘xxx’ from ‘yyy’ 问题
python·selenium·测试工具·flask·scikit-learn·fastapi·pip
不老刘20 小时前
macOS/Linux ClaudeCode 安装指南及 Claude Sonnet 4.5 介绍
linux·macos·ai编程·claude·vibecoding
醉、倾城1 天前
面向开发人员的macOS入门教程
macos·策略模式
2501_916013742 天前
iOS 26 系统流畅度检测 从视觉特效到帧率稳定的实战策略
android·macos·ios·小程序·uni-app·cocoa·iphone
游戏开发爱好者82 天前
iOS 26 崩溃日志深度解读,获取方式、系统变动、定位策略
android·macos·ios·小程序·uni-app·cocoa·iphone
StrongerIrene2 天前
mac 安装npm之后,其他终端无法访问
macos
深盾科技2 天前
如何读懂Mach-O:构建macOS和iOS应用安全的第一道认知防线
安全·macos·ios
FreeBuf_2 天前
iOS 0Day漏洞CVE-2025-24085相关PoC利用细节已公开
macos·ios·cocoa