Octopi 1.0.0 does not include RPI.GPIO?

Yesterday installed the Octopi 1.0.0 image.
The log shows a ModuleNotFoundError: No module named 'RPi' for one of my plugins.
Should I install RPi.GPIO manually using pip?

What did you already try to solve it?

I checked site-packages and confirmed RPi is not there
I confirmed RPi was installed in my backup of the old installation pre 1.0.0

Have you tried running in safe mode?

NO

Systeminfo Bundle

octoprint-systeminfo-20230302120339.zip (20.9 KB)

Additional information about your setup

Latest Octopi 1.0.0 from Raspberry Imager

How did you install this plugin? I can't see it being installed in the systeminfo bundle log.

The plugin that is trying to import RPi.GPIO (octoprint_smart_filament_sensor) is located at .octoprint.plugins. I am working on it.
I didn't install it. I copied it from my local development setup.
Problem is indicated in lines 255-271 of the octoprint.log

I asked how you installed it, I can see the error in the log, just no details of the plugin being installed. If you just placed it yourself in ~/.octoprint/plugins, then none of the dependencies that are listed in setup.py get installed alongside it. RPi.GPIO has never been installed by default in OctoPrint's virtual environment to the best of my knowledge.

Thanks, I understand.
In my previous setup RPi.GPIO was probably installed as a requirement for another plugin.
As I didn't install any of the plugins I had before, RPi is not there yet.
Thanks again for the warm welcome and sorry if my answer didn't exactly fit your question.

1 Like

Why can't you tell us the names of the plugins?

Why can't you tell us the names of the plugins?

I did: octoprint_smart_filament_sensor
Still I do not know why this is useful. You can read the plugin name in the octoprint.log I attached, but it is a fork heavily modified from the original. So the name is meaningless without the code.

Because I do not know. I could check all the plugins I had installed and try to remember those I only tested and uninstalled in my previous setup and try to ascertain which one had the requirement, but I am not sure if this will provide any additional info to my question.

Nice community.

Since you are developing (or modifying) the plugin, I think the question to ask is how do I add a requirement for RPi.GPIO to the plugin so it will automagically be installed when the plugin is installed (I don't know the answer or I'd give it to you).

That would make sense that it turned up as a requirement previously - it happens commonly as well as dependencies aren't uninstalled if you remove a plugin.

When I'm developing plugins, I like to install them using pip in editable mode, so that the dependencies are installed at the same time as the plugin.

If you have your plugin project/git repo somewhere on your Pi, with OctoPrint's virtual environment activated (running ~/oprint/bin/activate), you can run pip install -e . inside your project's folder, and the setup.py file is processed by pip, and dependencies etc. are installed. To use with OctoPrint while developing it doesn't really make a functional difference, I feel like I just prefer it so I can develop outside the data folder.

Sorry, didn't recognized it at the first glance.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.