I wanted to use the i2clcd library and was directed toward using a virtual environment. That worked, but then I want to use other gpio pins for a button instance. Gpio LED is working in the script and the i2clcd is working, but if I try to define a button, I get file not found and Error 2 etc when I call button = Button(5).
The particular gpio pin doesn't matter, any Button() attempt fails.
If I exit the virtual environment and run sudo python the examples work without errors.
So it seems like some kind of permission or path issue in the virtual environment, but why does the LED implementation and the i2clcd, both using gpio pins.
Some very basic information needed to provide anything other than wild guessing as a response!!
What model of RPi board?
What Operating System is it running?
Please post a copy of your script(s), noting the guidelines about code formatting.
Please post the full traceback of any resulting errors when you run the script(s).
The Raspberry Pi documentation will almost certainly have the answer to your query.
Ref: Use Python on a Raspberry Pi - https://www.raspberrypi.com/documentati ... spberry-pi
It may be important to know precisely how you have created and activated your Python virtual environment(s).
Statistics: Posted by B.Goode — Thu Jul 11, 2024 11:01 am