Quantcast
Viewing all articles
Browse latest Browse all 5067

Beginners • Re: 6 weeks and out of time

activate your venv
then type python
you are now in the Python REPL/Terminal, and you can use python commands
type
import RPi.GPIO
it should fail
try
import lgpio
it should also fail


Exit your venv
go to your venv folder, edit pyvenv.cfg
It should be obvious once in there what to set to true. [ set include-system-site-packages = true ]
save and reactivate, start python, test the imports.
It should work.

I just tested here to make sure.

I mention lgpio as it may be a good time to try and move over to it. BUT get RPi.GPIO working first. Scrap that you'd have to rewrite the modules unless Waveshare have updated it.


Actually, I don't think you need to import RPi.GPIO in your python code, as the module (where it is failing) does that for the module, your code doesn't use it as far as I can see. Unless it's just a failsafe if the module doesn't shutdown on an error.?

Statistics: Posted by bensimmo — Sun Dec 22, 2024 7:27 pm



Viewing all articles
Browse latest Browse all 5067

Trending Articles