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

pip install in latest debian and ubuntu requires --break-system-packages... or venv. #797

Closed
petersilva opened this issue Oct 26, 2023 · 5 comments
Labels
bug Something isn't working Developer not a problem, more of a note to self for devs about work to do. Discussion_Needed developers should discuss this issue. help wanted Extra attention is needed regression Broke something that was working before.

Comments

@petersilva
Copy link
Contributor

my laptop has ubuntu 23.04 on it, I think... and when I try to do the traditiona l pip install -e . for local development...
but in the latest OS's I get:

blacklab% pip3 install -e .
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.
blacklab% pip3 install --break-system-packages -e .


@petersilva
Copy link
Contributor Author

This will probably eventually break all the github actions which install non repo available packages with pip.
probably need to adopt venv and migrate actions to use it.

@petersilva petersilva added help wanted Extra attention is needed Developer not a problem, more of a note to self for devs about work to do. regression Broke something that was working before. Discussion_Needed developers should discuss this issue. bug Something isn't working labels Oct 26, 2023
@petersilva
Copy link
Contributor Author

@petersilva
Copy link
Contributor Author

https://stackoverflow.com/questions/76499565/python-does-not-find-module-installed-with-pipx

pipx installed apps are self-isolated, so you can't install dependencies for them? I don't get how this works....
"
pipx(Install and Run Python Applications in Isolated Environments) is not an equal alternative to pip(The Python Package Installer) ... It uses pip and works differently too … It isolates the apps/packages it downloads ... So, they are not made available to system Python outside that isolated environment ... It creates a separate virtual environment for each app it installs … Its main purpose, however, is to make Python apps run-able as regular commands from the command-line in the console/terminal and not to make them available(importable) to your Python interpreter."

source: https://askubuntu.com/questions/1481763/importing-python-packages-installed-with-pipx

so... we definitely do not want pipx, because we want people running python code to be able to do import sarracenia.
It isn't a standalone package.

@petersilva
Copy link
Contributor Author

when I installed metpx-sr3 with pipx, it could not see any packages installed via pip.... this is a feature? checking with sr3 features many were missing. did not quite understand the pattern (was it that packages installed with pip were missing? I seem to recall normal system ones were missing too... did not quite understand... have to look again.)

@petersilva
Copy link
Contributor Author

This is essentially a dup of #740 ... I got a pyproject.toml working, which gets rid of this error message, but I don't know how to create an RPM for redhat environments.

I think just close this one in favour of #740

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Developer not a problem, more of a note to self for devs about work to do. Discussion_Needed developers should discuss this issue. help wanted Extra attention is needed regression Broke something that was working before.
Projects
None yet
Development

No branches or pull requests

1 participant