GFX HAT Cap1xxx.py file not found error

I have purchase a GFX HAT for a small project, but I get the following error when I try and run the Hello World example:

file “usr/local/lib/python3.9/dist-packages/cap1xxx.py”, line 261, in init
self.i2c = SMBus(i2c_bus)
FileNotFoundError: [Errno 2] No such file or directory

If I follow that path the file looks like it is there.

I have found various references to this issue on line, but nothing appears to work.

The Raspberry Pi install in a week old.

I’m not very experienced in the Pi world, so any help will be greatly appriciated.

That would tend to suggest that you haven’t enabled i2c on your Raspberry Pi - check in the raspbi-config tool (I think it’s under ‘interface options’?)

1 Like

What he said. That error message isn’t very intiuitive as to its actual cause. It does hint that it is an i2c error though. If it’s not enabled, turning it on should get rid of that error message. It has for me in the past.

Sorted,
Many Thanks
Andrew