Nitropy / nk3: new error with

Recently (probably after a system upgrade), I have been getting an error running:

nitropy nk3 secrets get-password $PWID

Traceback (most recent call last):
  File "/usr/bin/nitropy", line 5, in <module>
    from pynitrokey.cli import main
  File "/usr/lib/python3.12/site-packages/pynitrokey/cli/", line 26, in <module>
    from pynitrokey.cli.nk3 import nk3
  File "/usr/lib/python3.12/site-packages/pynitrokey/cli/nk3/", line 19, in <module>
    from pynitrokey.nk3 import NK3_DATA
  File "/usr/lib/python3.12/site-packages/pynitrokey/nk3/", line 14, in <module>
    from pynitrokey.trussed.bootloader.nrf52 import SignatureKey
  File "/usr/lib/python3.12/site-packages/pynitrokey/trussed/bootloader/", line 29, in <module>
    from .nrf52_upload.dfu.init_packet_pb import InitPacketPB
  File "/usr/lib/python3.12/site-packages/pynitrokey/trussed/bootloader/nrf52_upload/dfu/", line 39, in <module>
    from . import dfu_cc_pb2 as pb
  File "/usr/lib/python3.12/site-packages/pynitrokey/trussed/bootloader/nrf52_upload/dfu/", line 34, in <module>
  File "/usr/lib/python3.12/site-packages/google/protobuf/", line 920, in __new__
TypeError: Descriptors cannot be created directly.
If this call came from a file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

More information:

On one hand, I can simply set export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python on my system and everything works, however I would like to resolve the issue and based on the file-paths it seems like this might be something that should be solved by pynitrokey.

Someone already added an issue for it at incompatible with recent protobuf version · Issue #548 · Nitrokey/pynitrokey · GitHub
(even with a fix proposal) and Nitrokey acknowledged existence. Best to watch that space.

1 Like