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

Using Raspian Bookworm OS #139

Open
2rkoester opened this issue Aug 19, 2024 · 2 comments
Open

Using Raspian Bookworm OS #139

2rkoester opened this issue Aug 19, 2024 · 2 comments

Comments

@2rkoester
Copy link

Wondered if anyone has installed this software on Bookworm OS. It appears the rpi_power_monitor fails to install with an error:externally-managed_environment.

@David00
Copy link
Owner

David00 commented Aug 20, 2024

Hi @2rkoester, it is possible to install on Bookworm, but you'll want to create a Python virtual environment and set the project up inside it. You can do so like this:

cd ~/
sudo apt update; sudo apt install python3-venv
python3 -m venv venv
source venv/bin/activate

You'll notice that your terminal now has a (venv) at the front of the line. This means you've activated the virtual environment named venv. The activation is done with the command source venv/bin/activate. You can deactivate it at any time by typing deactivate.

You can then proceed to follow the Manual Installation steps. The virtual environment only needs to be active for step # 10, but there shouldn't be any harm in leaving it active for the entire installation.

You'll also need to update the Python path for the service file created in step 12 of the Manual Installation guide. The ExecStart path should use the newly created Python3 executable in the virtual environment. It should be /home/pi/venv/bin/python3, but to make sure, you can type which python3 when the virtual environment is activated, and it will show you the path to the new Python3 binary. If your Python path is /home/pi/venv/bin/python3, then the ExectStart line should look like this:

ExecStart=/home/pi/venv/bin/python3 /home/pi/rpi_power_monitor/rpi_power_monitor/power_monitor.py

One final note is that any commands in the documentation where you are running the power_monitor.py file (like step 15 in the Manual Install guide) will need to be run when the virtual environment is activated. If you run the power_monitor.py file without having the virtual environment active, it will complain when trying to import the libraries because they're technically only installed to the Python instance inside the virtual environment.

I definitely want to get an updated custom OS image out, but I'll need to write new docs because they're all based on not having a Python virtual environment. This of course also has implications on existing deployments ever trying to upgrade in the future.

@2rkoester
Copy link
Author

Thank you, I will give that a try.
Also do you have any suggestions on how to edit the config.toml file when using a mounted network drive for backup rather than an attached usb drive? I don't believe there would be a valid entry for the backup_device.

Love your product, I have been using for several years and have three machines setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants