Comments (13)
It appears that the supplied install scripts depend on configparser
and the all-in-one example depends on RPi.GPIO
and spidev
, none of which are installed by default on buster lite. Can they also be added as dependencies and installed automatically?
To get the examples running I had to execute the following before being able to run the examples:
sudo apt install python-pip
pip install configparser
pip3 install RPi.GPIO
pip3 install spidev
(for added confusion, configparser
is required by python2 while most people will be using python3 for everything else!)
from enviroplus-python.
I'm guessing this is the Raspbian Lite flavour of Buster? Python, at least, should be installed by default but - indeed - numpy
and smbus
should go into the installer.
from enviroplus-python.
Correct. Using the lite. It wasn't specified and knowing that intent for this is in a "headless" setup I didn't think I needed the full desktop.
Another concern is when trying to install Pillow via PIP I got a out of memory error and had to build a swap in order to install. I believe Pillow comes with the desktop Buster so maybe just update documentation that the full desktop version is required?
from enviroplus-python.
Yeah- it absolutely should be good to go for a headless setup, i would be silly not to.
Pillow is one of the many Python packages that's paradoxically better served by apt, basically anything with significant C bindings is an uncompromising nightmare to install via pip. While there's a project to build Raspberry Pi-compatible wheels for all Python packages - https://www.piwheels.org/ - it only serves a subset of Python versions.
Looks like I need to include python-pil
and python3-pil
. You can install these with sudo apt install python-pil python3-pil
albeit it's probably too late now.
Thanks for being an unwitting beginner and helping bash the rough edges off this installer- it's easy to lose sight of the wood for the trees when you've done this stuff for so long!
from enviroplus-python.
Thank you- I'll get these added ASAP. I'm hoping to roll the same installer out across other products, so this wisdom will be shared.
I'd swear Lite has become even lighter as of late, and it's certainly not a route I'd point beginners. Raspbian Desktop can be run headless by setting console startup mode in raspi-config
and skirts some of the endless rigamarole of identifying and installing dependencies.
Alas there's not much I can do about the python2/python3 duality, although I do wonder if it's time to bite the tech support bullet and start forcing users to learn python3
in lieu of python
. On earlier releases it's not safe to assume that python3
is even installed, and installing an entire additional runtime always felt a bit bruteforce to me.
from enviroplus-python.
Also, at least on Buster (Pi Zero W, brand new install of Buster Lite), make sure user is in group video
to access vcgencmd
, and dialout
for the serial. The default pi
user is, but it's not particularly straightforward for a beginner to figure out which device it needs, and the error isn't informative.
I'd suggest that the script(s) can be made to work for either Python easily, and the installer would use Python 3 if it's installed; Python 2 if not; and install and use Python 3 if neither are there. (?)
For an outside Luftdaten box, a Zero with Buster Lite on a small card and no screen is not unreasonable... full desktop Buster on a Zero is not fun, and all that activity would reduce the lifetime (well, mean-time-before-filesystem-corruption) of it.
I've rolled my own script to not run the ST7735 (pointless outside and fouls the light reading within an enclosure), reduce the CPU temperature compensation factor (I have the pHAT on a ribbon cable to get it away from the Pi), send the appropriate values to Luftdaten, and send all the values to MQTT for local logging and display.
Next I have to come up with an enclosure that'll be weatherproof and deliver Lux readings. It'd be good to include an extension ribbon cable with the Enviro+, or at least offer one as an accessory.
from enviroplus-python.
I also managed to install/use Buster Lite, with the below workaround
$ sudo apt install python-configparser python-setuptools spi-tools python-spidev
$ sudo apt install python3-setuptools python3-spidev
plus a $ git pull
of the current code in the repo and a $ pip3 install RPi.GPIO
but Python3 compatibily should be investigated/confirmed, as it is not given #21
from enviroplus-python.
Just finished running the install and I have been through getting started with enviro plus on a pi Zero with wifi and header.
$ uname -a
Linux pi 4.19.75+ #1270 Tue Sep 24 18:38:54 BST 2019 armv6l GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 10 (buster)
Release: 10
Codename: buster
After running the install, which prompted to install the examples, which were in ~/Pimoroni/enviroplus/examples
and not enviroplus-python/examles
, everything ran OK, until I ran the lcd.py.
~/Pimoroni/enviroplus/examples $ python lcd.py
Traceback (most recent call last)
File "lcd.py", line 3, in <module>
import ST7735
File "/usr/local/lib/python2.7/dist-packages/ST7735-0.0.3-py2.7.egg/ST7735/__init__.py", line 25, in <module>
import spidev
ImportError: No module named spidev
~/Pimoroni/enviroplus/examples $ pip install spidev
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting spidev
Downloading https://files.pythonhosted.org/packages/fb/14/4c2e1640f0cb04862c76d9d76ed7c945b0f67876e503ac02f7f675fe86a0/spidev-3.4.tar.gz
Building wheels for collected packages: spidev
Running setup.py bdist_wheel for spidev ... done
Stored in directory: /home/pi/.cache/pip/wheels/10/d6/98/ba1f1999099e3e7adb3a0140af8c9287ff2b067ff005485674
Successfully built spidev
Installing collected packages: spidev
Successfully installed spidev-3.4
~/Pimoroni/enviroplus/examples $ python lcd.py
2019-11-09 18:11:45.914 INFO lcd.py - Hello, World! example on the 0.96" LCD.
Press Ctrl+C to exit!
I repeated this for python3:
~/Pimoroni/enviroplus/examples $ python3 lcd.py
Traceback (most recent call last):
File "lcd.py", line 3, in <module>
import ST7735
File "/usr/local/lib/python3.7/dist-packages/ST7735-0.0.3-py3.7.egg/ST7735/__init__.py", line 25, in <module>
import spidev
ModuleNotFoundError: No module named 'spidev'
~/Pimoroni/enviroplus/examples $ pip3 install sdidev
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting sdidev
Could not install packages due to an EnvironmentError: 404 Client Error: Not Found for url: https://pypi.org/simple/sdidev/
Thought you should know.
from enviroplus-python.
@dxcSithLord have you tried my $ sudo steps listed just above your post here?
from enviroplus-python.
Following your suggestion, I ran
~/Pimoroni/enviroplus/examples $ sudo apt install python3-setuptools python3-spidev
If I run lcd.py after that, I get a different error:
python3 lcd.py
Traceback (most recent call last):
File "lcd.py", line 3, in <module>
import ST7735
File "/usr/local/lib/python3.7/dist-packages/ST7735-0.0.3-py3.7.egg/ST7735/__init__.py", line 26, in <module>
import RPi.GPIO as GPIO
ModuleNotFoundError: No module named 'RPi'
~/Pimoroni/enviroplus/examples $ pip3 install RPi.GPIO
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting RPi.GPIO
Downloading https://www.piwheels.org/simple/rpi-gpio/RPi.GPIO-0.7.0-cp37-cp37m-linux_armv6l.whl (69kB)
Installing collected packages: RPi.GPIO
Successfully installed RPi.GPIO-0.7.0
~/Pimoroni/enviroplus/examples $ python3 lcd.py
2019-11-10 22:10:22.021 INFO lcd.py - Hello, World! example on the 0.96" LCD.
Press Ctrl+C to exit!
So that worked.
from enviroplus-python.
I installed this on Buster Lite versions 2019-09-26
and 2020-02-05
.
I needed to install sudo apt-get install git
so I can clone the repo and pip install spidev
so I can run LCD examples. Everything else was installed by install script.
from enviroplus-python.
I followed all the instructions including those above, lcd.py and all-in-one.py are working, but python luftdaten.py fails with:
Traceback (most recent call last):
File "luftdaten.py", line 3, in <module>
import requests
ImportError: No module named requests
Unless you run the following (I imagine there's a better option):
pip install requests
from enviroplus-python.
I followed all the instructions including those above, lcd.py and all-in-one.py are working, but python luftdaten.py fails with:
Traceback (most recent call last): File "luftdaten.py", line 3, in <module> import requests ImportError: No module named requests
Unless you run the following (I imagine there's a better option):
pip install requests
@Darthmonkey I am getting this same issue, any fix for this yet?
from enviroplus-python.
Related Issues (20)
- NumPy Error when working with LCD HOT 1
- Install script does not install all required python libraries HOT 4
- all_in_one (and combined) needs to recalculate humidity based on compensated temperature HOT 3
- Gas sensor not returning values HOT 3
- Migrate Lufdaten.py to Sensors Community (luftdaten.py) HOT 1
- Install script is missing a of dependencies and simply does not work HOT 3
- PMS5003 best use HOT 6
- light.py sample fails to run on new Enviro+ HOT 3
- BME280 - Pressure / Humidity Incorrect Readings HOT 3
- Failed to read PMS5003 (fresh latest install) HOT 1
- Pillow 10 compatibility HOT 1
- install.sh not working when trying to install over SSH HOT 6
- Installing enviroplus-python library and running lcd.py does not work HOT 3
- Error `/usr/bin/raspi-config: 2909: do_serial_cons: not found` when running install.sh HOT 1
- Will not install. Tried multiple methods and multiple pi's and multiple pi os versions. HOT 7
- Suddenly not starting, reporting an issue with `get_pin` HOT 1
- GPIO24: not found HOT 7
- (pms5003) Not working on Pi Zero / Bookworm HOT 5
- pms5003 on bookworm - Raspberry Pi 2 HOT 3
- LCD does not show anything only backlight is on HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from enviroplus-python.