I want to update a plugin called OctoRelay and I am running 1 under the latest version (3.12.4) the documentation for the plugin says that I need at least 3.9 which I satisfy. I have upgraded OctoPrint to the latest version without a hitch.
The error and says otherwise.
ERROR: Package 'octorelay' requires a different Python: 3.7.3
If your system has Python 3.9+ then you'll need to recreate the OctoPrint venv using the newer Python version and reinstall.
How do I do that pleae?
Backup and reflash to the latest OctoPi version.
What do you mean 'reflash' my understanding is to use the raspbery pi imager to create a new image io the SD Card. and what do I backup please?
I really am confused here. I am running OctoPrint 1.10.3 without any problems, except the plugin update. Is this not the latest version? If so, why do I need to update please?
What is being suggested is that to solve your issue you should create a new install of OctoPrint by following the instructions you seem to already understand of creating(Flashing) the OctoPi image and then use that in your existing Rasbery Pi.
But take note, before you do that step, it is suggested that you create a backup of your existing install. This is done from inside OctoPrint. There is an existing Plugin (Backup & Restore) to make this easy. You can find this in the OctoPring Settings dialog "OCTOPRINT" section. Follow the instructions for that Plugin to complete the backUp process.
Then you do the process of creating a new fresh install of OctoPi/OctoPrint. During setup you will have the option of applying the backUp you created. Do that...
If you follow these steps, you should have your issue resolved.
The real issue you have is that your Pi has an old version of Python on it. The one that is running the Octoprint instance. You maybe think you installed a newer version of Python but you did not do it as needed. This is proven by the error in your log.
Since you do not seem to be familiar with the details needed to get that right. It would be tedious for someone to walk you through that. So it is suggested that you do the above to get you where you need to be. It is likely the process with the best chance for success as well as the fastest way to get there.
There's an easier way I think. @foosel created this for re-creating the venv.
https://github.com/OctoPrint/venv-tool#migrating-a-venv-to-a-newer-python-version
I suspect the octopi image you flashed was version 0.18, which came pre-loaded with python 3.7. The OctoPi 1.0.0 release ships with Python 3.9. As others have already mentioned, reflashing the octopi 1.0.0 version would get you to the minimum required python version needed for that plugin, but the link I just shared for re-creating the venv may be another approach if you have truly successfully upgraded your OS system level python version to 3.12.
EDIT: a simple way to verify that is if you SSH to the pi and run python --version
it will tell you what version you actually have at the OS system level.
Many thanks for the help. In principal this solution seems the best way forward. However I did not know where the 'venv' was. I had previously successfully installed 3.12 without problem.
Many thanks for the solution. If I'd have known that OctoPi uses a 'private' copy of python it would have made more sense. The backup/restore worked a treat (I guess that I'm not using third party plugins)
Hello,
I have a problem to update the octorelay plugin because my python has to be 3.9 and I am in 3.7.
So, I try to follow your advice:
[quote="@jneilliii, post:11, topic:61195, full:true"]
There's an easier way I think. @foosel created this for re-creating the venv.
Unfortunately, I don't know what to replace the paths with to run this command:
octoprint-venv-tool recreate-venv /path/to/your/venv --python /path/to/python
I give you my directories.
Could you please give me the solution ?
Thanks a lot
Michel
The first step would be figuring out how to install the newer Python on the system first. It would be much easier/quicker to just create a backup, download backup, flash newest OctoPi image and restore backup during initial setup wizard of the new install.
Yes, you're right, but it's difficult to reach the SD card. My octoprint is in a box with a four-channel relay and a 5" screen. So the dismantling is difficult.
If I could reinstall a new image without taking the SD apart, that would be nice, but I'm not sure it's possible.
I would suggest that you add Micro SD Card Extender to your configuration. Micro SD cards don't last forever so eventually you will want to replace it.
Good idea.
I use rpi-clone to backup the SD before I install my box.
That way, if my card dies, I have a spare one.
Do you have access to the USB ports? Depending on which pi you have you could flash the new octopi to a usb flash/thumb drive and set it as the primary boot device. This is actually how I run OctoPi on my Pi 4s partially for that specific reason.
Hello,
I use two RPI3, one for each printer, and I have access to the USB ports.
When I make a rpi-clone, I clone my sd card through this port.
But how can I boot through this port.
The 3B+ supports it out of the box, I think you just have to set it to prefer usb in raspi-config over SD card. More details can be found on this page. Keep in mind, any reference to /boot/firmware/config.txt
, that file will actually exist at /boot/config.txt
.
https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#usb-mass-storage-boot