You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At some point we put together a "helpful" install verification script for Enviro+, but OS changes are going to break it so it'll be dropped - for now - in pimoroni/enviroplus-python#126
It would be nice to have some kind of install check/debug script as part of the boilerplate, perhaps.
#!/usr/bin/env python3# -*- coding: utf-8 -*-f"Sorry! This program requires Python >= 3.6 😅. Run with \"python3 check-install.py\""CONFIG_FILE="/boot/config.txt"print("""Checking Enviro+ install, please wait...""")
errors=0check_apt=Falsetry:
importaptcheck_apt=TrueexceptImportErorr:
print("⚠️ Could not import \"apt\". Unable to verify system dependencies.")
apt_deps= {
"python3",
"python3-pip",
"python3-numpy",
"python3-smbus",
"python3-pil",
"python3-cffi",
"python3-spidev",
"python3-rpi.gpio",
"libportaudio2"
}
deps= {
"bme280": None,
"pms5003": None,
"ltr559": None,
"ST7735": None,
"ads1015": "0.0.7",
"fonts": None,
"font_roboto": None,
"astral": None,
"pytz": None,
"sounddevice": None,
"paho.mqtt": None
}
config= {
"dtparam=i2c_arm=on",
"dtparam=spi=on",
"dtoverlay=adau7002-simple",
"dtoverlay=pi3-miniuart-bt",
"enable_uart=1"
}
ifcheck_apt:
print("\nSystem dependencies...")
print(" Retrieving cache...")
cache=apt.Cache()
fordepinapt_deps:
installed=Falseprint(f" Checking for {dep}".ljust(35), end="")
try:
installed=cache[dep].is_installedexceptKeyError:
passifinstalled:
print("✅")
else:
print("⚠️ Missing!")
errors+=1print("\nPython dependencies...")
fordep, versionindeps.items():
print(f" Checking for {dep}".ljust(35), end="")
try:
__import__(dep)
print("✅")
exceptImportError:
print("⚠️ Missing!")
errors+=1print("\nSystem config...")
config_txt=open(CONFIG_FILE, "r").read().split("\n")
defcheck_config(line):
globalerrorsprint(f" Checking for {line} in {CONFIG_FILE}: ", end="")
forclineinconfig_txt:
ifcline.startswith(line):
print("✅")
returnprint("⚠️ Missing!")
errors+=1forlineinconfig:
check_config(line)
iferrors>0:
print("\n⚠️ Config errors were found! Something might be awry.")
else:
print("\n✅ Looks good from here!")
print("\nHave you?")
print(" • Rebooted after installing")
print(" • Made sure to run examples with \"python3\"")
print(" • Checked for any errors when running \"sudo ./install.sh\"")
The text was updated successfully, but these errors were encountered:
At some point we put together a "helpful" install verification script for Enviro+, but OS changes are going to break it so it'll be dropped - for now - in pimoroni/enviroplus-python#126
It would be nice to have some kind of install check/debug script as part of the boilerplate, perhaps.
The text was updated successfully, but these errors were encountered: