This environment is externally managed;hint: See PEP 668 for the detailed specification.解决办法

部署运行你感兴趣的模型镜像

安装pandas库时报错

报错代码

error: externally-managed-environment

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.

这时我们输入

(mmpretrain) lxleave@DESKTOP-VP4CD3L:~/mmpretrain$ which python
/home/lxleave/miniconda3/envs/mmpretrain/bin/python
(mmpretrain) lxleave@DESKTOP-VP4CD3L:~/mmpretrain$ which pip
/usr/bin/pip

可以看到python环境和pip的位置不一致,这是 系统 pip,不在 conda 环境中,也就是说,刚刚装的包被装进了系统 Python中,而不是 conda 环境里。

解决办法:

安装包的时候加一个python -m

python -m pip install pandas

您可能感兴趣的与本文相关的镜像

Python3.9

Python3.9

Conda
Python

Python 是一种高级、解释型、通用的编程语言,以其简洁易读的语法而闻名,适用于广泛的应用,包括Web开发、数据分析、人工智能和自动化脚本

lhj@raspberrypi:~ $ # 先卸载残留文件 pip uninstall scikit-learn -y # 使用清华镜像源加速安装 pip install scikit-learn -i https://pypi.tuna.tsinghua.edu.cn/simple --upgrade --force-reinstall error: externally-managed-environment × This environment is externally managed ╰─> To install Python packages system-wide, try apt install python3-xyz, where xyz is the package you are trying to install. If you wish to install a non-Debian-packaged Python package, create a virtual environment using python3 -m venv path/to/venv. Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make sure you have python3-full installed. For more information visit http://rptl.io/venv 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. error: externally-managed-environment × This environment is externally managed ╰─> To install Python packages system-wide, try apt install python3-xyz, where xyz is the package you are trying to install. If you wish to install a non-Debian-packaged Python package, create a virtual environment using python3 -m venv path/to/venv. Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make sure you have python3-full installed. For more information visit http://rptl.io/venv 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.
07-22
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值