PiBrewing / craftbeerpi4

GNU General Public License v3.0
57 stars 29 forks source link

Latest Raspberry OS update #117

Closed dimontau closed 10 months ago

dimontau commented 11 months ago

Greetings to all. After updating Raspberry OS to the latest version, an error appears: pi@raspberrypi:~ $ sudo pip3 install https://github.com/PiBrewing/craftbeerpi4/archive/master.zip 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. pi@raspberrypi:~ $ sudo pip3 install cbpi4 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.

avollkopf commented 11 months ago

Please add more information on how you have updated your OS to the latest version (update of existing os, starting with a new image,....). Please add as much information as possible. Otherwise, a replication of the issue may take plenty of time and can be done just by chance.

And what is the python version of the latest os?

dimontau commented 11 months ago

I installed the latest official version of Raspberry OS, dated October 10th, 2023 using Raspberry Pi Imager. And now I get this error when installing any Python packages. Probably something changed in the raspberry OS itself. I have installed Raspberry Pi OS with desktop and recommended software 64bit

avollkopf commented 11 months ago

ok, i have not tested in on 'bookworm' just on bullseye which is currently also recommended for cbpi4 as per documentation.

You might need to go to the legacy bullseye images for now. It'll take some time for me to test the installation on the latest os.

avollkopf commented 11 months ago

Just to reference the general issue: https://medium.com/@kiena/troubleshooting-externally-managed-environment-error-in-debian-12-pip3-installation-439d62e5a970

avollkopf commented 11 months ago

I started working on a test repo

-> after fresh install of the latest os (bookworm) you need to install pipx (sudo apt install pipx) and install cbpi via pipx w/o sudo

e.g.: pipx install cbpi4

I can start cbpi now w/o sudo on my test system and I can also create the service for autostart.

Some things might probably not be working now. Needs further testing.

avollkopf commented 11 months ago

some tests were done with bookworm and it is basically working with the bookworm-test branch.

  1. Install the full bookworm image via pi imager
  2. update and upgrade the system as described in the documentation
  3. install libatlas-base-dev as described in the documentation
  4. install pipx with sudo apt install pipx
  5. install cbpi with pipx install https://github.com/PiBrewing/craftbeerpi4/archive/bookworm-test.zip. You could also clone the repo, checkout the corresponding branch and install it from your local drive.
  6. run also pip ensurepath to add the virtual environment path created with pipx to your PATH
  7. Assuming you are using user 'pi', run source /home/pi/.local/pipx/venvs/cbpi4/bin/activate to switch to the virtual environment. You can always leave the virtual environment with the command deactivate.
  8. Plugins must be installed inside the virtual environment with python -m pip install PLUGINNAME (OR PLUGINPATH). (e.g. cbpi4-pt100x or https://github.com/PiBrewing/cbpi4-pt100x/archive/main.zip)
  9. leave the virtual environment after plugin installation with deactivate.
  10. run cbpi autostart on to start cbpi automatically on boot
  11. if you want to start cbpi manually fom the command lin, don't use sudo. sudo is not required and won't work (also for pluin installation)

I have tested it with a SD card on my production system and the hardware (onewire, pt1000, SCD30 CO2 sensor, actors,...) are working.

BUT there seem to be quite some changes with bookworm as my Display cannot be rotated in the same way as with Bullseye and older versions of the OS. Although I managed it now somehow, I do not recommend to replace your 'production system' with the latest OS at this point of time. Please just test it on a separate SD card if you want. It'll take some time for thorough testing. I also can't get vnc to work which might be related to the display topic

EDIT: X11 has been replaced with wayland which seems to require different settings (It'll also affect chromium startup in kiosk mode)

avollkopf commented 10 months ago

cbpi is now working under bookworm. Some changes were required and installation instructions have been updated.

-> cbpi 4.2.0.a6 in dev branch or t pypi.org can be used