Adafruit_BMP in python 3

0

I'm testing the BMP180 sensor on RaspberryPi 3 B + and when I run the file on Raspbian it gives me this error:

WhenIrunthesamefilethroughthecommandlineitgivesthevaluesitshouldgive,itdoesnotgiveanerror,ascanbeseenfromthefollowingimage:

What could be happening to make this error?

    
asked by anonymous 26.07.2018 / 11:31

1 answer

0

Modules are not shared between Python versions.

By default, in Raspbian the python command points to version 2.7 of Python. You can confirm this through the second line of the image of your terminal

Python 2.7.13 (default, Nov 24 2017, 17:33:09)

Already, when run by IDLE, you are running with version 3.5.3, see the first line that appears in the program

Python 3.5.3 (default, Jan 19 2017, 14:11:04)

That is, you have the Adafruit_BMP module installed correctly in version 2.7, but not in 3.5. Just see which one you will use. If it's 2.7, you'll need to open IDLE in this version too, but if it's 3.5, you'll have to install the module in this version.

    
26.07.2018 / 13:16