Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/test/Downloads/anki-sync-server-git/src/anki-sync-server/src/ankisyncd/__main__.py", line 8, in <module>
import ankisyncd.sync_app
File "/home/test/Downloads/anki-sync-server-git/src/anki-sync-server/src/ankisyncd/sync_app.py", line 33, in <module>
from anki.collection import Collection
File "/home/test/.local/lib/python3.10/site-packages/anki/collection.py", line 10, in <module>
from anki import (
File "/home/test/.local/lib/python3.10/site-packages/anki/card_rendering_pb2.py", line 14, in <module>
from anki import generic_pb2 as anki_dot_generic__pb2
File "/home/test/.local/lib/python3.10/site-packages/anki/generic_pb2.py", line 28, in <module>
_EMPTY = _descriptor.Descriptor(
File "/home/test/.local/lib/python3.10/site-packages/google/protobuf/descriptor.py", line 313, in __new__
_message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py 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: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
After installing python packages in 'requirements.txt' then running
python -m ankisyncdI get this error:Downgrading the
protobufpackage as directed does fix it but I'm not sure if that's the most appropriate solution or if I'm missing something?