sunfounder / SunFounder_SensorKit_for_RPi2

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

No module named Adafruit_BMP #4

Open ash73 opened 7 years ago

ash73 commented 7 years ago

Hi, I'm using a BMP180 sensor with a Raspberry Pi3 and the sample python program works ok in Python 2, but I get this error in Python 3:

import Adafruit_BMP.BMP085 as BMP085 ImportError: No module named 'Adafruit_BMP'

I'm new this; is it possible to get it working in Python 3? TIA

sunfounder commented 7 years ago

Sorry the codes are all for Python 2, not Python 3 temporarily. It is possible to run the code in Python 3, for more information, you can it check out in Python.org but it might be a lot of work.

smalhao commented 6 years ago

I have the same problem, with example file simpletest.py works but when i run my program with sockets the error is this:

Traceback (most recent call last): File "sensorServer.py", line 2, in import Adafruit_BMP.BMP085 as BMP085 ImportError: No module named 'Adafruit_BMP'

ash73 commented 6 years ago

Try:

sudo apt-get install python-smbus i2c-tools sudo apt-get install build-essential python-dev python-smbus cd ~ git clone https://github.com/sunfounder/Adafruit_Python_BMP.git cd Adafruit_Python_BMP python3 setup.py install cd BMP180/SunFounder_SensorKit_for_RPi2/Python/ python3 31_barometer.py

Back then I didn't know there are separate install commands for Py2 and Py3.

sunfounder commented 6 years ago

Hi, Thanks for contacting us.Your question, I have asked our engineers help , if they give any results, I will inform you immediately, if there are other questions, please contact us anytime, we will try our best to solve it for you.

Best Regards Jake

support@sunfounder.com

From: ash73 Date: 2018-07-31 10:43 To: sunfounder/SunFounder_SensorKit_for_RPi2 CC: SunFounder; Comment Subject: Re: [sunfounder/SunFounder_SensorKit_for_RPi2] No module named Adafruit_BMP (#4) Try: sudo apt-get install python-smbus i2c-tools sudo apt-get install build-essential python-dev python-smbus cd ~ git clone https://github.com/sunfounder/Adafruit_Python_BMP.git cd Adafruit_Python_BMP python3 setup.py install cd BMP180/SunFounder_SensorKit_for_RPi2/Python/ python3 31_barometer.py Back then I didn't know there are separate install commands for Py2 and Py3. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

sunfounder commented 6 years ago

Hi dear

Yes, Python 3 needs to re-execute CD ~ CD Adafruit_Python_BMP Python 3 setup.py install before CD BMP180/SunFounder_SensorKit_for_RPi2/Python/ 31 _barometer python3. Py

Best Regards Jake

support@sunfounder.com

From: ash73 Date: 2018-07-31 10:43 To: sunfounder/SunFounder_SensorKit_for_RPi2 CC: SunFounder; Comment Subject: Re: [sunfounder/SunFounder_SensorKit_for_RPi2] No module named Adafruit_BMP (#4) Try: sudo apt-get install python-smbus i2c-tools sudo apt-get install build-essential python-dev python-smbus cd ~ git clone https://github.com/sunfounder/Adafruit_Python_BMP.git cd Adafruit_Python_BMP python3 setup.py install cd BMP180/SunFounder_SensorKit_for_RPi2/Python/ python3 31_barometer.py Back then I didn't know there are separate install commands for Py2 and Py3. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

sunfounder commented 6 years ago

Hi smalhao Thanks for contacting us. Python 3 needs to re-execute CD ~ CD Adafruit_Python_BMP Python 3 setup.py install before CD BMP180/SunFounder_SensorKit_for_RPi2/Python/ 31 _barometer python3. Py

Best Regards Jake

support@sunfounder.com

From: smalhao Date: 2018-07-31 05:51 To: sunfounder/SunFounder_SensorKit_for_RPi2 CC: SunFounder; Comment Subject: Re: [sunfounder/SunFounder_SensorKit_for_RPi2] No module named Adafruit_BMP (#4) I have the same problem, with example file simpletest.py works but when i run my program with sockets the error is this: Traceback (most recent call last): File "sensorServer.py", line 2, in import Adafruit_BMP.BMP085 as BMP085 ImportError: No module named 'Adafruit_BMP' — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

smalhao commented 6 years ago

Hi Jake Can I send my code to see if it can tell me how to pass the temperature value of the BMP180 sensor from a raspberry pi to another raspberry pi through the Ethernet network through communication with the socket library?

Best regards, Sérgio Malhão De: SunFounder notifications@github.com Enviada: 2 de agosto de 2018 13:45 Para: sunfounder/SunFounder_SensorKit_for_RPi2 SunFounder_SensorKit_for_RPi2@noreply.github.com Cc: Sérgio Miguel Nunes Malhão smalhao@ipcbcampus.pt; Comment comment@noreply.github.com Assunto: Re: [sunfounder/SunFounder_SensorKit_for_RPi2] No module named Adafruit_BMP (#4)

Hi smalhao Thanks for contacting us. Python 3 needs to re-execute CD ~ CD Adafruit_Python_BMP Python 3 setup.py install before CD BMP180/SunFounder_SensorKit_for_RPi2/Python/ 31 _barometer python3. Py

Best Regards Jake

support@sunfounder.com

From: smalhao Date: 2018-07-31 05:51 To: sunfounder/SunFounder_SensorKit_for_RPi2 CC: SunFounder; Comment Subject: Re: [sunfounder/SunFounder_SensorKit_for_RPi2] No module named Adafruit_BMP (#4) I have the same problem, with example file simpletest.py works but when i run my program with sockets the error is this: Traceback (most recent call last): File "sensorServer.py", line 2, in import Adafruit_BMP.BMP085 as BMP085 ImportError: No module named 'Adafruit_BMP' — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/sunfounder/SunFounder_SensorKit_for_RPi2/issues/4#issuecomment-409913206, or mute the threadhttps://github.com/notifications/unsubscribe-auth/Ac0U81OMSi-aDofMx5Nx0_aarlkbyFduks5uMvQ8gaJpZM4Ly0KM.