ePiframe icon indicating copy to clipboard operation
ePiframe copied to clipboard

Python install will fail because of protected python default environment.

Open steffenix opened this issue 1 year ago • 3 comments

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.

steffenix avatar May 29 '24 17:05 steffenix

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.

NateEaton avatar Jul 25 '24 19:07 NateEaton

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

MikeGawi avatar Jul 29 '24 19:07 MikeGawi

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

drdotpepper avatar Jul 31 '24 10:07 drdotpepper