English 中文(简体)
我如何每次使用第3页时解决“error:外部管理-环境”问题?
原标题:How do I solve "error: externally-managed-environment" every time I use pip 3?

错误信息:

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.

    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.

    See /usr/share/doc/python3.11/README.venv for more information.

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.

我使用适当的升级和更新。

问题回答

页: 1

然而,如果你真的想要安装这样的包件,那么就存在几种解决办法:

  • use pip s argument --break-system-packages,
  • add following lines to ~/.config/pip/pip.conf:
[global]
break-system-packages = true

我从3.11和3.11+起就发现了这一错误。

sudo rm /usr/lib/python3.11/EXTERNALLY-MANAGED

http://code>pip。 允许推翻<代码>外部管理的-环境错误,并在整个系统安装 Python包。

pip install package_name --break-system-packages

注:使用该旗帜的帽子。

我安装了pipx。 第一:

apt install pipx

然后,我使用<代码>pipx安装radian:

pipx install radian

之后确认安装地点(在我订购的Visualroom Code)时,我:

pipx list

正义

python3 -m venv ~/.local --system-site-packages

www.un.org/chinese/ga/president 你们的道路

然后使用

~/.local/bin/pip install ... # --user is implied ;)

你可能只是创建自己的<条码>~/py,并从那里开始编制所有文件。 然而,我想. local已经在PATH和进口名录上登出。

灰尘像系统管理人员那样。 不同的软件使用多种不同的产品。

A few times, I ve used pip3 to install things... that break other things. Sometimes I mix it with "apt-get install".

这一错误信息与天平一样,因为它迫使我们做事。 它是指包裹管理人(Ubuntu,) ,而不是pip

It s why we have Conda, or Miniconda.

You can create an environment using something like

conda create --name thenameofmyapp python=3.8

利用你的环境

conda activate pixray

之后,你可以“安装——r requirements.txt”,不会打破你的系统: 它只是在特定环境中安装。

# rm /usr/lib/python3.11/EXTERNALLY-MANAGED

使用:

  1. 开放式终端

  2. ∗∗∗∗∗

  3. 加入:

    [global]
    break-system-packages = true
    
  4. Ctrl+X 之后Y > ——>(除nano

Everything is updated now you can run pip install <package_name>.

That issue is from pip. Just run the command and it will downgrade it.

pip install pip==22.3.1 --break-system-packages

Surely that will help.

如下:

sudo rm EXTERNALLY-MANAGED

如果你选择恢复这一机制,就会再次向触角指挥部提出同样的档案:

sudo touch EXTERNALLY-MANAGED

我在利用Docker形象的管道工作上执行一些任务时,一直在处理这个问题。 我以前没有过这个问题,但由于我没有为多克的形象使用任何具体标签,我也没有感到非常惊讶。

我指挥着:

python3 -m pip install --upgrade pip

改为:

python3 -m pip install --upgrade pip --break-system-packages

事情照旧。

It happened to me after I changed the name of the folder containing my virtual environment.
If you want to rename a virtual environment, changing the name of the folder doesn t work. I recreated it.

sudo -H pip3 install --break-system-packages --upgrade package

good work on Debian 12

a. 安装第三十包,而不是安装

pip install XXX

Try:

sudo apt install python3-XXX




相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...

热门标签