Open a terminal and run the following commands:
sudo raspi-config Choose Interfacing Options -> I2C ->yes
Reboot Raspberry Pi:
sudo reboot