sunfounder / SunFounder_SensorKit_for_RPi2

SunFounder Sensor Kit V2.0 for Raspberry Pi 2
GNU General Public License v2.0
114 stars 85 forks source link

Issue to run code getting PCF8591 says no module #1

Open mkowndinya opened 8 years ago

mkowndinya commented 8 years ago

import PCF8591 as ADC ImportError: No module named PCF8591

sunfounder commented 8 years ago

@mkowndinya That's weird, which directory did you run the code on?

hijackindie commented 7 years ago

I have a similar problem working with the sensor kit and a raspberry pi 3 running kernel 4.4.38-v7+. Traceback (most recent call last): File "13_pcf8591.py", line 2, in import PCF8591 as ADC File "/home/pi/SunFounder_SensorKit_for_RPi2/Python/PCF8591.py", line 23, in bus = smbus.SMBus(1) IOError: [Errno 2] No such file or directory

hijackindie commented 7 years ago

I got this working. I needed to enable I2C on the PI using raspi-config.

sunfounder commented 7 years ago

Yes, you need to enable I2C first, if you have any problems, welcome to post it on our forum: https://www.sunfounder.com/forum, or email us: support@sunfounder.com or of course, open an issue here.

hemalparikh123 commented 6 years ago

im getting an error line 44 in PCF8951.py return bus.read_byte(address)

what could i do to fix this?

yosefgadban commented 5 years ago

I got this working. I needed to enable I2C on the PI using raspi-config.

I have a similar problem and i enabled I2C . still the same error

SamGosselin commented 4 years ago

Also having this issue. Code listed below: Traceback (most recent call last): File "18_thermistor.py", line 2, in <module> import PCF8591 as ADC File "/home/pi/SunFounder_SensorKit_for_RPi2/Python/PCF8591.py", line 23, in <module> bus = smbus.SMBus(1) IOError: [Errno 2] No such file or directory

If anyone knows a fix I would greatly appreciate a link or simple command. Thanks.

LuisValverde1296 commented 4 years ago

I'm also having troubles with this import, already enabled I2C and tried some other stuff I saw on different sources and still don't have a possitive result. If anyone has a propper fix please answer to my prayers. Thanks

elijah247 commented 3 years ago

i am having the same problem, someone please answer!

mschulz67 commented 2 years ago

If you're toying around with the sunfounder sensor kit: There's a file PCF8591.py (https://github.com/sunfounder/SunFounder_SensorKit_for_RPi2/blob/master/Python/PCF8591.py) that must be in the same directory as the executing script.