This environment is externally managed ╰─> To install Python packages system-wide, try apt install

It seems like you are trying to install a Python package in an externally-managed environment. This error message usually occurs when you are trying to install a package system-wide, but the environment is managed by an external tool or package manager. In this case, you can try installing the package using the following command:

sudo apt install python3-<package-name>

Replace <package-name> with the name of the package you are trying to install. This command should install the package system-wide and make it available to all users on the system.

If you wish to install a non-Debian-packaged Python package, you can create a virtual environment using the following command:

python3 -m venv path/to/venv

This will create a new virtual environment in the specified directory. You can then activate the environment and install packages using pip as usual.

参考文档
(1) How do I install a pip package globally instead of locally?. https://stackoverflow.com/questions/36936212/how-do-i-install-a-pip-package-globally-instead-of-locally.
(2) Ubuntu 中 Pip 的外部管理环境错误. https://cn.linux-console.net/?p=17687.
(3) Pip install and Python’s externally managed | Kali Linux Blog. https://www.kali.org/blog/python-externally-managed/.
(4) Installing Packages - Python Packaging User Guide. https://packaging.python.org/tutorials/installing-packages/.
(5) undefined. https://stackoverflow.com/a/43623102/.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

完颜振江

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值