Looking back at my post, I must admit that I was pretty sparse in the information I gave. In the meantime I also solved the problem in a totally different way, so I am no longer dependent on the smbus2 version, but here goes …
Back then I had programmed my own switch. The folder with the switch then has the following minimal components.
The REQUIREMENTS = [‘smbus2==0.3.1’] line is located in the switch.py file.
I didn’t find back the requirements in the abelectronicsuk library you mentioned. If you want to add it nevertheless, I would try adding the line in the IOPi.py file.
… and I would change the
try:
from smbus2 import SMBus
except ImportError:
try:
from smbus import SMBus
except ImportError:
raise ImportError("python-smbus or smbus2 not found")
lines into:
REQUIREMENTS = ['smbus2==0.3.1']
try:
from smbus2 import SMBus
except ImportError:
raise ImportError("python-smbus2 not found")