mqtt-io icon indicating copy to clipboard operation
mqtt-io copied to clipboard

ImportError

Open wojta95 opened this issue 3 years ago • 0 comments

Describe the bug After installing the script on Raspberry Pi Zero 2, the script won't start.

Error messages and traceback

Could not import runpy module
Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 14, in <module>
    import importlib.machinery # importlib first so we can test #15386 via -m
  File "/usr/lib/python3.7/importlib/__init__.py", line 57, in <module>
    import types
  File "/home/pi/.local/lib/python3.7/site-packages/mqtt_io/types.py", line 5, in <module>
    from typing import TYPE_CHECKING, Any, Dict, Union
  File "/usr/lib/python3.7/typing.py", line 28, in <module>
    import re as stdlib_re  # Avoid confusion with the re we export.
  File "/usr/lib/python3.7/re.py", line 122, in <module>
    import enum
  File "/usr/lib/python3.7/enum.py", line 2, in <module>
    from types import MappingProxyType, DynamicClassAttribute
ImportError: cannot import name 'MappingProxyType' from 'types' (/home/pi/.local/lib/python3.7/site-packages/mqtt_io/types.py)

Config

mqtt:
  host: ---
  port: 1883
  user: ---
  password: ---
  topic_prefix: home/photoframe
  ha_discovery:
    enabled: yes


gpio_modules:
  - name: raspberrypi
    module: raspberrypi
    cleanup: yes

digital_inputs:
  - name: power_in
    module: raspberrypi
    pin: 23

digital_outputs:
  - name: power_out
    module: raspberrypi
    pin: 4

Hardware

  • Raspberry Pi Zero 2
  • Connected hardware: digital input from an LCD driver board and output is driving a transistor controlling the same LCD driver

System:

  • OS: Raspbian
  • Python version: Python 3.7.3
  • User you're running as: pi, tried root as well
  • Using a virtualenv?: no

Additional context Add any other context about the problem here.

wojta95 avatar Jan 15 '22 10:01 wojta95