ubuntu24.04安装numpy时报错error: externally-managed-environment解决办法

报错的原因

✅ 是 Ubuntu 不允许你用 pip 往系统 Python 装包

解决方案:用 venv 虚拟环境

复制代码
# 1. 安装完整 Python 组件
sudo apt install python3-full python3-venv -y

# 2. 创建虚拟环境
python3 -m venv ~/venv

# 3. 激活虚拟环境
source ~/venv/bin/activate

pip install numpy
相关推荐
人工小情绪1 天前
python报错:AttributeError: module ‘numpy‘ has no attribute ‘object‘.
python·numpy·neo4j
郑泰科技2 天前
python深度学习报错:Original error was: No module named ‘numpy.core._multiarray_umath‘
python·深度学习·numpy
Java后端的Ai之路2 天前
【Python进阶学习】-NumPy详细介绍指南(附demo)
python·学习·numpy
laplace01232 天前
LangChain 1.0 入门实战 · Part 6:LangChain Agent 中间件(Middleware)入门介绍
笔记·python·中间件·langchain·numpy·pandas
laplace01233 天前
LangChain 1.0 入门实战(Part 1)详细笔记
笔记·python·langchain·numpy·pandas
liu****3 天前
04_Pandas数据分析入门
python·jupyter·数据挖掘·数据分析·numpy·pandas·python常用工具
玄同7654 天前
Python 装饰器:LLM API 的安全与可观测性增强
开发语言·人工智能·python·安全·自然语言处理·numpy·装饰器
adjust25864 天前
day 46
人工智能·机器学习·numpy
渡我白衣4 天前
计算机组成原理(11):加法器
python·机器学习·numpy·pandas·matplotlib·计组·数电