Can't use PIP in PenguinVM

283 views
Skip to first unread message

Gianluca Cavallo

unread,
Feb 20, 2024, 8:23:28 AM2/20/24
to ChromiumOS Discussion
Hello all,
I don't know why form a moment to another one my penguinVM refuses to install python packet with the command: 
python -m pip install [packet name]

the error is this:

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.

Someone knows how to fix it ?

Thanks

Mike Frysinger

unread,
Feb 20, 2024, 8:40:40 AM2/20/24
to Gianluca Cavallo, ChromiumOS Discussion
this is a Debian thing, so you'd probably be better off asking a Debian users group
-mike 


--
--
Chromium OS Discussion mailing list: chromium-...@chromium.org
View archives, change email options, or unsubscribe:
https://groups.google.com/a/chromium.org/group/chromium-os-discuss

Gianluca Cavallo

unread,
Feb 20, 2024, 8:45:39 AM2/20/24
to Mike Frysinger, ChromiumOS Discussion
Yes but ChromeOs is linux based.. isn't it ?

Mike Frysinger

unread,
Feb 20, 2024, 9:25:05 AM2/20/24
to Gianluca Cavallo, ChromiumOS Discussion
why does that matter? the penguin VM is running a stock Debian install. so questions like this aren't questions about CrOS behavior, they're generic Debian questions.
-mike 

Gianluca Cavallo

unread,
Feb 20, 2024, 9:46:57 AM2/20/24
to Mike Frysinger, ChromiumOS Discussion
It is simple a counter-sense, than I just have seen other question about penguinVM.
Is it penguinVM a part of chromeOS ? or not ?
Is it integrated in a ChromeOS, that is linux based ?
Than penguinVM can be managed by cros with no developer mode activated.
So why do not give support about it ?
Your answer in this case is very strange and I don't get it

DennisLfromGA

unread,
Feb 20, 2024, 10:03:31 AM2/20/24
to ChromiumOS Discussion, Gianluca Cavallo, ChromiumOS Discussion, Mike Frysinger
Gianluca,

In my penguin container running the bookworm release python3.11 is installed by default and is soft-linked to python3, see below:

ll /usr/bin/python*
lrwxrwxrwx 1 root root   10 Apr  9  2023 /usr/bin/python3 -> python3.11*

So perhaps using the following would work for you: python3 -m pip install [packet name]

~DennyL

Gianluca Cavallo

unread,
Feb 20, 2024, 10:06:48 AM2/20/24
to DennisLfromGA, ChromiumOS Discussion, Mike Frysinger
Sorry it doesn't work...
But thank you the same

Gianluca Cavallo

unread,
Feb 20, 2024, 10:13:08 AM2/20/24
to DennisLfromGA, ChromiumOS Discussion, Mike Frysinger
what does it mean EXTERNALLY-MANAGED ???

that is an error that appears me recently....
Some tip ?

Mike Frysinger

unread,
Feb 20, 2024, 10:15:23 AM2/20/24
to Gianluca Cavallo, ChromiumOS Discussion
the penguin VM is a developer focused feature that runs a stock Debian container. we support the ways the container integrates with the device (e.g. graphical apps showing up), but otherwise, general Linux/Debian questions should be posted to the respective groups.

just because we run Linux and provide a Debian container doesn't mean we offer support for every random package in Debian that a user installs. do you expect us to offer programming advice for every language Debian ships? or how to configure every random service Debian includes? you are asking questions about how Debian has set things up. CrOS did not have a hand in that.
-mike 

Mike Frysinger

unread,
Feb 20, 2024, 10:16:00 AM2/20/24
to Gianluca Cavallo, DennisLfromGA, ChromiumOS Discussion
again, this is a Debian question. please seek support from them.
-mike 

Gianluca Cavallo

unread,
Feb 21, 2024, 11:11:58 AM2/21/24
to Mike Frysinger, DennisLfromGA, ChromiumOS Discussion
Dear Mike,
I thank you a lot for your help and for your efforts to explain the error.
But consider than the limitation to penguinVM in python pip packets installation is only about the chromeOS, if I use WSL on windows this problem is not.
So, my questio is also why the developers put that.
Than consider that I performed a powerwash and the error in pip packet is still there:

error: externally-managed-environment

This error means that who though about pengiunVM decide to do something....
So I get your position, but again, if someone want to answer or have found a fix or the cause for this "externally managed" I will appreciate a lot.


DennisLfromGA

unread,
Feb 21, 2024, 11:46:26 AM2/21/24
to ChromiumOS Discussion, Gianluca Cavallo, DennisLfromGA, ChromiumOS Discussion, Mike Frysinger
Gianluca,

If you google that error message you'll find (at least) two ways to avoid it using a (risky) workaround:

  • sudo mv /usr/lib/python3.11/EXTERNALLY-MANAGED /usr/lib/python3.11/EXTERNALLY-MANAGED.old

or maybe better:

  • pip install package_name --break-system-packages

NOTE: Use of these workarounds shouldn't be abused.

~DennyL

Gianluca Cavallo

unread,
Feb 21, 2024, 4:27:19 PM2/21/24
to DennisLfromGA, ChromiumOS Discussion, Mike Frysinger
Denny,
Thank you for your solution.
Unfortunately I didn't find it on google.
Consider that write in the forums is like to google things. If someone find in some question or  in some post is enought to not answer.


Gianluca Cavallo

unread,
Feb 21, 2024, 4:29:47 PM2/21/24
to DennisLfromGA, ChromiumOS Discussion, Mike Frysinger
*Consider that write in the forums is like to google things. If someone find in some question or  in some post a cause of bother is enought to not answer.

dragon788

unread,
Feb 21, 2024, 5:25:36 PM2/21/24
to cavallo.gianl...@gmail.com, DennisLfromGA, ChromiumOS Discussion, Mike Frysinger
You need to `sudo apt update && sudo apt install python3-pip`. The package isn't installed by default because it bloats the size of the image and many many users will never need it.

Exactly what Mike said is true, the Linux apps are there is a convenience for developers who want to work in an environment similar to where their applications may get deployed in the cloud but don't want to go into Developer Mode and remove any layers of the security protections of Chrome OS, but they are not building any of the images used by penguin whether Debian or Arch or Fedora etc, that is handled by the LXC container organization, Google has been incredibly smart with the resources by not trying to spin up their own version or infrastructure and just leaning on the open source community to maintain things that they were going to maintain anyways.

---
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-os-dis...@chromium.org.

Mike Frysinger

unread,
Feb 21, 2024, 7:18:30 PM2/21/24
to Gianluca Cavallo, DennisLfromGA, ChromiumOS Discussion
this is not, in any way, specific to penguinVM/CrOS.  as i've said, this is something Debian chose to do.  install Debian on your desktop and it will behave the same, and CrOS isn't involved anywhere.  would you then seek support with your PC manufacturer like Dell or HP because of software you installed ?

the fact that your WSL doesn't behave this way is irrelevant.
-mike

Gianluca Cavallo

unread,
Feb 22, 2024, 4:02:31 AM2/22/24
to Mike Frysinger, DennisLfromGA, ChromiumOS Discussion
Dears,
The solution that works for me was what Dennis wrote...
So I found what i was looking for. 
Of course I look forward to help someone if I can

All the best for all the others existential problems.
I would reccomend a camomile.

DennisLfromGA

unread,
Feb 22, 2024, 8:22:50 AM2/22/24
to ChromiumOS Discussion, Gianluca Cavallo, DennisLfromGA, ChromiumOS Discussion, Mike Frysinger
Gianluca,

Glad that worked for you.

~DennyL

Reply all
Reply to author
Forward
0 new messages