enviroplus-python icon indicating copy to clipboard operation
enviroplus-python copied to clipboard

problems with enviro + library

Open belidi opened this issue 4 years ago • 8 comments

I have a problem with the enviro (+) library with an enviro card. When I launch weather.py I get these messages:   Traceback (most recent call last):    File "/home/pi/enviroplus-python/examples/weather.py", line 4, in      from bme280 import BME280    File "/usr/local/lib/python3.7/dist-packages/pimoroni_bme280-0.0.2-py3.7.egg/bme280/init.py", line 2, in      from i2cdevice import Device, Register, BitField, _int_to_bytes ModuleNotFoundError: No module named 'i2cdevice'

I did ; pip install i2cdevice and bme280, but always the same,

belidi avatar May 14 '20 16:05 belidi

Same issue. Hoping to find out if something else uses SMBus at the same time??

StarlightLab avatar May 15 '20 06:05 StarlightLab

This is odd, since the bme280 module requires i2cdevice, and installation should fail where it's not available.

In your case you're running under Python 3, so you should try:

sudo pip3 install i2cdevice

Do you have any further information about the OS version you're running, any errors encountered in the install process or other clues that could reveal how your system got into this situation?

Gadgetoid avatar May 15 '20 10:05 Gadgetoid

The correction of i2cdevice is done, thanks for the correction (pip3). There remains now the problem of the BME280 module which causes the following error: Traceback (most recent call last):    File "/home/pi/enviroplus-python/examples/weather.py", line 4, in      from bme280 import BME280 ImportError: cannot import name 'BME280' from 'bme280' (/usr/local/lib/python3.7/dist-packages/bme280/init.py)

pi zero W Raspbian Buster with desktop 4.19.97+ # 1294 installation of the library by github (git clone ...).

belidi avatar May 16 '20 07:05 belidi

I think you need the Pimoroni version of the BME library where BME280 is a class. On my system it is pimoroni_bme280-0.0.2-py3.7.egg

nophead avatar May 16 '20 10:05 nophead

after doing: sudo pip3 install pimoroni-bme280, it remains the same always the same error message.should i start from a new installation: os + library

belidi avatar May 18 '20 10:05 belidi

Perhaps you just need to uninstall the other version you had before. I don't know what search order it uses.

nophead avatar May 18 '20 11:05 nophead

I am also having the same issue and have tried all of the above suggestions. Is there anything further I can try to get this working?

Other sensors on the Enviro+ appear to be working and it is just this one which is not.

aussieEd avatar Oct 31 '20 10:10 aussieEd

I am also having the same issue and have tried all of the above suggestions. Is there anything further I can try to get this working?

Other sensors on the Enviro+ appear to be working and it is just this one which is not.

@aussieEd - There appears to be an issue with v0.1.0 of the Pimoroni BME280 library, see https://github.com/pimoroni/bme280-python/issues/12 along with a workaround

daniel-rhoades avatar Nov 01 '20 15:11 daniel-rhoades