-
if you are using python3 make sure that you install:
pip3 install smbus smbus2
for GPIO, you may have to set the following: export CFLAGS=-fcommon pip3 install RPi.gpio