Hi, I've been using OctoRelay for some time and currently at version 4.2.0. I have tried to upgrade to the latest version (currently 5.1.0) and it is failing. My python version is 3.12.4. The logs have a couple of errors:
ERROR: Package 'octorelay' requires a different Python: 3.7.3 not in '<4,>=3.9'
2024-11-12 15:08:27,344 - octoprint.plugins.softwareupdate - ERROR - Update of octorelay can not be performed, please also check plugin_softwareupdate_console.log for possible causes of this
Traceback (most recent call last):
File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/plugins/softwareupdate/__init__.py", line 2214, in _perform_update
force=force,
File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/plugins/softwareupdate/updaters/pip.py", line 127, in perform_update
"Error while executing pip install", (stdout, stderr)
octoprint.plugins.softwareupdate.exceptions.UpdateError: Error while executing pip install
I know next to nothing about python so any help would be appreceiated.
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.
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.
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
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.
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.