python smbus IOError: [Errno 2] No such file or directory

 

1.打开配置文件

sudo nano /boot/config.txt

打开以下选项

"dtparam=i2c_arm=on"

ctrl + o 保存

ctrl + x 退出

 

2.刷新配置文件

sudo raspi-config

 

3.打开 I2c选项

 

4.重启

 

5.再次运行

 

参考:

https://www.raspberrypi.org/forums/viewtopic.php?t=100189

posted @ 2019-06-30 23:46  anobscureretreat  阅读(1165)  评论(0编辑  收藏  举报