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.
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.
Statistics: Posted by bensimmo — Sun Dec 22, 2024 7:27 pm