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

pip3 throws externally-managed-environment error (PEP 668) #217

Closed
dehahost opened this issue Sep 11, 2023 · 0 comments · Fixed by #198
Closed

pip3 throws externally-managed-environment error (PEP 668) #217

dehahost opened this issue Sep 11, 2023 · 0 comments · Fixed by #198
Labels
bug Something isn't working

Comments

@dehahost
Copy link

dehahost commented Sep 11, 2023

Describe the bug

When executing the ./scripts/install.sh script, the pip3 command throws an error stating that PyPI packages cannot be mixed with those from APT packages.

(.venv)  ~/repo/github/Yin-Yang@beta % ./scripts/install.sh
enter password in order to install Yin-Yang correctly
Uninstalling old version, if it exists
Removing config and .desktop file
Removing program and terminal execution
Removing manifest
Removing systemd units
Yin-Yang uninstalled succesfully
have a nice day ...
Installing dependencies …
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.

Affected versions

  • Yin-Yang version: beta branch, commit a46f8cd
  • Relevant application version: -
  • Python version: 3.11.4 (main, Jun 9 2023, 07:59:55) [GCC 12.3.0]
  • Qt version: 5.15.8

Additional notes

I am using Kubuntu 23.04 with Kubuntu Backports PPA.
I solved this issue by modifying following scripts ...

  • scripts/install.sh prepares venv in /opt/yin-yang
  • resources/yin-yang uses python3 from it
    • ...and also tries to respect existing installations by ignoring missing venv folder
@dehahost dehahost added the bug Something isn't working label Sep 11, 2023
l0drex added a commit that referenced this issue Oct 7, 2023
@l0drex l0drex linked a pull request Oct 7, 2023 that will close this issue
12 tasks
@l0drex l0drex mentioned this issue Oct 7, 2023
12 tasks
@l0drex l0drex closed this as completed in 9ee8316 Nov 10, 2023
chase9 pushed a commit to chase9/Yin-Yang that referenced this issue Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant