ocpp: Failed to set Up Integration on HA2023.9.3


Logger: homeassistant.setup
Source: custom_components/ocpp/__init__.py:12
Integration: Open Charge Point Protocol (OCPP) ([documentation](https://github.com/lbbrhzn/ocpp/blob/main/README.md), [issues](https://github.com/lbbrhzn/ocpp/issues))
First occurred: 11:25:13 (1 occurrences)
Last logged: 11:25:13

Setup failed for custom integration ocpp: Unable to import component: cannot import name '_validators' from 'jsonschema' (/usr/local/lib/python3.11/site-packages/jsonschema/__init__.py)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 215, in _async_setup_component
    component = integration.get_component()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 818, in get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/config/custom_components/ocpp/__init__.py", line 12, in <module>
    from ocpp.v16.enums import AuthorizationStatus
  File "/usr/local/lib/python3.11/site-packages/ocpp/v16/__init__.py", line 1, in <module>
    from ocpp.charge_point import ChargePoint as cp
  File "/usr/local/lib/python3.11/site-packages/ocpp/charge_point.py", line 11, in <module>
    from ocpp.messages import Call, MessageType, unpack, validate_payload
  File "/usr/local/lib/python3.11/site-packages/ocpp/messages.py", line 12, in <module>
    from jsonschema import _validators as SchemaValidators
ImportError: cannot import name '_validators' from 'jsonschema' (/usr/local/lib/python3.11/site-packages/jsonschema/__init__.py)

About this issue

  • Original URL
  • State: closed
  • Created 9 months ago
  • Reactions: 14
  • Comments: 34 (3 by maintainers)

Most upvoted comments

Works like a charm again 😄. Thank you.

Can someone please confirm that the release v0.4.41 solves the issue?

Confirm!

Can someone please confirm that the release v0.4.41 solves the issue?

I’ve just updated and can confirm its now working… Thankyou.

Wanna bet that @lbbrhzn and @drc38 already understood that this is a problem for everyone who updated HA?!

Same! Here my setup

`<html>

<body>

<div class="header_title" style="margin-right: 32px; margin-inline-end: 32px; margin-inline-start: initial; direction: var(--direction);">Informazioni di sistema</div><ha-icon-button dialogaction="close" class="header_button" style="display: inline-block; outline: 0px; position: absolute; right: 16px; top: 14px; text-decoration: none; color: inherit; inset-inline-start: initial; inset-inline-end: 16px; direction: var(--direction);"><mwc-icon-button title="Chiudi" style="display: inline-block; outline: 0px; --mdc-ripple-color: currentcolor; -webkit-tap-highlight-color: transparent; vertical-align: top; --mdc-theme-on-primary: currentColor; --mdc-theme-text-disabled-on-light: var(--disabled-text-color);"><button class="mdc-icon-button mdc-icon-button--display-flex" aria-label="Chiudi" style="font-size: 24px; width: var(--mdc-icon-button-size,48px); height: var(--mdc-icon-button-size,48px); padding: calc((var(--mdc-icon-button-size,48px) - var(--mdc-icon-size,24px))/ 2); display: inline-flex; position: relative; box-sizing: border-box; border: none; outline: 0px; background-color: transparent; fill: currentcolor; color: inherit; text-decoration: none; cursor: pointer; user-select: none; z-index: 0; overflow: visible; align-items: center; justify-content: center; vertical-align: top;"><span><slot><ha-svg-icon style="display: block; align-items: center; justify-content: center; position: relative; vertical-align: middle; fill: currentcolor; width: var(--mdc-icon-size,24px); height: var(--mdc-icon-size,24px);"><svg preserveAspectRatio="xMidYMid meet" focusable="false" role="img" aria-hidden="true" viewBox="0 0 24 24"><g><path d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"></path></g></svg></ha-svg-icon></slot></span></button></mwc-icon-button></ha-icon-button>

<div id="content" class="mdc-dialog__content" style="-webkit-font-smoothing: antialiased; font-family: var(--mdc-typography-body1-font-family,var(--mdc-typography-font-family,Roboto,sans-serif)); font-size: 14px; line-height: var(--mdc-typography-body1-line-height,1.5rem); font-weight: 400; letter-spacing: var(--mdc-typography-body1-letter-spacing,.03125em); text-decoration-line: ; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; text-transform: none; flex-grow: 1; box-sizing: border-box; margin: 0px; overflow: auto; color: rgb(255, 255, 255); padding: var(--dialog-content-padding,24px); position: var(--dialog-content-position,relative); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; text-indent: 0px; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal;"><slot id="contentSlot" style="margin-top: 0px; margin-bottom: 0px;"><div><div>
Versione core-2023.9.3
Tipo di installazione Home Assistant OS
Sviluppo false
Supervisor true
Docker true
Utente root
Ambiente virtuale false
Versione Python 3.11.5
Famiglia del Sistema Operativo Linux
Versione del Sistema Operativo 6.1.21-v8
Architettura della CPU aarch64
Fuso orario Europe/Rome
Cartella di configurazione /config
</div></div></slot></div> </body> </html>`

Can someone please confirm that the release v0.4.41 solves the issue?

Created a new release v0.4.41 with the workaround, pinning jsonschema to 4.19.0.

you guys mean set the jsonschema version in the manifest like this?

"requirements": [ 
     "occp>=0.14.1",
      "websockets>=10.2",
      "jsonschema==4.19.0"
],
"version": "v0.4.40"

thats it

I confirm it works, remember de colon at the end of websockets if you add the new jsonschema version after it.

It doesn’t work for me, it doesn’t even allow me to delete the integration…

just remove addon in hacs presing ignore integration installed

you guys mean set the jsonschema version in the manifest like this?

"requirements": [ 
     "occp>=0.14.1",
      "websockets>=10.2",
      "jsonschema==4.19.0"
],
"version": "v0.4.40"

thats it