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

Python install will fail because of protected python default environment. #108

Open
steffenix opened this issue May 29, 2024 · 3 comments
Open
Assignees
Labels
bug Something isn't working research Solution searching

Comments

@steffenix
Copy link

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.
    
    For more information visit http://rptl.io/venv

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.

Adding a virtual env for the install might do the trick.

@MikeGawi MikeGawi self-assigned this May 30, 2024
@MikeGawi MikeGawi added bug Something isn't working research Solution searching labels May 30, 2024
@NateEaton
Copy link

I was initially frustrated by this but figured I would just watch this issue for a resolution and try again. However, in the meantime I tried installing a few other photoframe systems on github and after running into this same issue on two others, I dug deeper than I did the first time. While adding a virtual env might do the trick, after years of using Raspberry Pis for single-purpose use cases (other photoframe solutions, network gateways, etc.) I had decided that virtual environments might be great for general purpose compute environments but are (for me) an unnecessary complexity for single-purpose environments. It turns out that eventually that won't be an option: the common thread in all my attempts at installing various photoframe apps and running into this error is the OS version, Bookworm. It turns out that the Pi org made fundamental changes to the way Python is installed on Pi OS starting with Bookworm. See here for more information.

I've started over and used the legacy Pi install (Bullseye) and got all the way through the automatic installation without running into this issue. Based on the information from Pi about the future of the Pi OS, eventually there may not be a legacy option and your install will need to use a virtual env for Python components but, for now, this seems to be an alternative.

@MikeGawi
Copy link
Owner

Thanks for this comment, @NateEaton. I'm trying to find the solution that will solve this issue, so thanks again for the hint.

@drdotpepper
Copy link

Thanks NateEaton for the solution and thanks MikeGawi for this whole project - currently making a photo frame for my partner for her birthday

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working research Solution searching
Projects
None yet
Development

No branches or pull requests

4 participants