Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The environment of Python 3.11 is externally managed by default. #283

Open
larryw3i opened this issue Mar 26, 2023 · 4 comments
Open

The environment of Python 3.11 is externally managed by default. #283

larryw3i opened this issue Mar 26, 2023 · 4 comments

Comments

@larryw3i
Copy link
Contributor

Hey! @alejandroautalan ,
The environment of Python 3.11 is externally managed by default, it means that the site-packages can be installed via system's packages management tool only by default. So, may both pygubu and pygubu-designer need to be uploaded to Ubuntu software sources or Debian software sources.

The error logs are following:

larry@zx:~/Downloads$ pip3 install -U pygubu pygubu-designer
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.
larry@zx:~/Downloads$ python3
Python 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 

Regards,
larryw3i

@Aesonus
Copy link

Aesonus commented Oct 19, 2023

The fix for this is to use pip from a virtual environment as described in the error message:

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.

@rdbende
Copy link
Contributor

rdbende commented Oct 20, 2023

The fix for this is to use pip from a virtual environment as described in the error message:

But you shouldn't have to. It's okay to manage the venv for a library or another project, but as an end user of an app it's not.
Having a distro package for pygubu-designer would be great, but in the meantime we should recommend pipx (as the error message does, too), which pulls the packages from Pypi and automatically manages the venv for the application.

@Aesonus
Copy link

Aesonus commented Oct 28, 2023

I don't see any issues with allowing the detailed error message from the operating system to instruct potential users on how to use a virtual environment to install the designer. They already need command line experience to install the software in the first place, and this only affects versions of Ubuntu that rely on Python 3.11 for critical system functions. It would be great to cover every possible install environment, but I think that goes beyond what is necessary at this point.

@rdbende
Copy link
Contributor

rdbende commented Oct 28, 2023

I mean, even if users can follow the error message, set up a venv, and activate it before each launch, using pipx for this purpose is still much simpler. (And anyways, if users rely on the error message only, they may end up using --break-system-packages, which would be BAAD)

this only affects versions of Ubuntu that rely on Python 3.11 for critical system functions.

* Affects most Debian-based distros with Python >=3.11 installed, and AFAIK Arch has it now as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants