当前位置: 首页 > article >正文

Mac Python 安装依赖出错 error: externally-managed-environment

Mac Python 使用 ip3 install -r requirements.txt 出错

× This environment is externally managed
╰─> To install Python packages system-wide, try brew installxyz, where xyz is the package you are trying toinstall.If you wish to install a Python library that isn't in Homebrew,use a virtual environment:python3 -m venv path/to/venvsource path/to/venv/bin/activatepython3 -m pip install xyzIf you wish to install a Python application that isn't in Homebrew,it may be easiest to use 'pipx install xyz', which will manage avirtual environment for you. You can install pipx withbrew install pipxYou may restore the old behavior of pip by passingthe '--break-system-packages' flag to pip, or by adding'break-system-packages = true' to your pip.conf file. The latterwill permanently disable this error.If you disable this error, we STRONGLY recommend that you additionallypass the '--user' flag to pip, or set 'user = true' in your pip.conffile. Failure to do this can result in a broken Homebrew installation.Read more about this behavior here: <https://peps.python.org/pep-0668/>note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.[notice] A new release of pip is available: 24.0 -> 25.1.1
[notice] To update, run: python3.12 -m pip install --upgrade pip

解决方案:

python3 -m venv venv
source venv/bin/activate

重新运行 pip3 install -r requirements.txt

http://www.lryc.cn/news/2393697.html

相关文章:

  • Docker Desktop for Windows 系统设置说明文档
  • C++高级编程深度指南:内存管理、安全函数、递归、错误处理、命令行参数解析、可变参数应用与未定义行为规避
  • 【下拉选项数据管理优化实践:从硬编码到高扩展性架构】
  • IPD的基础理论与框架——(四)矩阵型组织:打破部门壁垒,构建高效协同的底层
  • 深度学习篇---OC-SORT实际应用效果
  • 讲述我的plc自学之路 第十一章
  • OpenLayers 图形绘制
  • 小程序为什么要安装SSL安全证书
  • python打卡训练营打卡记录day40
  • 互联网大厂Java求职面试:Spring Boot 3.2+自动配置原理、AOT编译及原生镜像
  • 小型图书管理系统案例(用于spring mvc 实践)
  • 【清晰教程】利用Git工具将本地项目push上传至GitHub仓库中
  • 20250529-C#知识:静态类、静态构造函数和拓展方法
  • 实验设计与分析(第6版,Montgomery)第4章随机化区组,拉丁方, 及有关设计4.5节思考题4.18~4.19 R语言解题
  • 第十篇:MySQL 实战:数据迁移、分库分表与分区技术指南
  • 【吾爱】逆向实战crackme160学习记录(一)
  • vue2 + webpack 老项目升级 node v22 + vite + vue2 实战全记录
  • opengauss 数据库安装主备 非om方式
  • STM32的HAL编码流程总结(上部)
  • 深度学习|pytorch基本运算
  • (自用)Java学习-5.15(模糊搜索,收藏,购物车)
  • 替代 WPS 的新思路?快速将 Word 转为图片 PDF
  • 【K8S】K8S基础概念
  • FEMFAT许可分析的数据可视化方法
  • 打印机无法远程打印?可以本地打印,本地网络打印机设置给异地使用
  • 包含Javascript的HTML静态页面调取本机摄像头
  • PCB设计实践(三十一)PCB设计中机械孔的合理设计与应用指南
  • deepseek问答记录:请讲解一下torch.full_like()
  • 【Linux篇章】Linux 进程信号2:解锁系统高效运作的 “隐藏指令”,开启性能飞跃新征程(精讲捕捉信号及OS运行机制)
  • 多功能秒达开源工具箱源码|完全开源的中文工具箱