Strange venv behaviour

Detlev Offenbach detlev at die-offenbachs.de
Mon Feb 17 16:30:00 GMT 2025


Hi Tony,

that makes absolutely sense.

Am 17.02.25 um 15:28 schrieb Tony Arnold:
> Hi,
>
> Not sure if this is a bug or a feature, but I've observed the
> following behaviour when configuring virtual environment on eric7 25.2
> running on Ubuntu 24.04.
>
> If I configure the python interpreter for a venv as /usr/bin/python3,
> then eric shows all the locally installed packages in the PyPi panel
> rather than just those in the venv. Also when trying to install a
> package in the venv, it gives an error saying the venv is locally managed.
With that Python interpreter configuration you are referring to the
globa interpreter and not the one of the virtual environment. As the
global Python packages are managed through the Ubuntu (Debian) package
manager, a user is not allowed to install packages via pip in the global
scope anymore. That was a change that happened (I think) with Debian 12
and Ubuntu 24.04.
>
> However, if I configure the interpreter to use the path of the venv,
> e.g., /home/venv/somevenv/bin/python3, then PyPi shows just the
> packages in that venv and allows installation and removal of packages
> within the venv.
That is the expected behavior because the configured interpreter is the
one of the virtual environment.
>
> Hope this makes sense.

Everything is fine here. Sometimes paths matter even if the final goal
is the same executable.

Regards
Detlev

--
Detlev Offenbach
detlev at die-offenbachs.de
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/eric/attachments/20250217/fd1b276b/attachment.htm>


More information about the Eric mailing list