Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong libprotobuf Version Dependency? #210

Open
astrostu opened this issue Sep 30, 2024 · 0 comments
Open

Wrong libprotobuf Version Dependency? #210

astrostu opened this issue Sep 30, 2024 · 0 comments

Comments

@astrostu
Copy link

I'm doing a new install and was running into issues for any of the available PLIO versions (1.5.2–1.5.5). I install it, then open Python and do something simple like import plio and the following results:

  File "<stdin>", line 1, in <module>
  File "/opt/anaconda3/envs/plio/lib/python3.12/site-packages/plio/__init__.py", line 17, in <module>
    from . import io
  File "/opt/anaconda3/envs/plio/lib/python3.12/site-packages/plio/io/__init__.py", line 22, in <module>
    from . import io_controlnetwork
  File "/opt/anaconda3/envs/plio/lib/python3.12/site-packages/plio/io/io_controlnetwork.py", line 10, in <module>
    from plio.io import ControlNetFileV0002_pb2 as cnf
  File "/opt/anaconda3/envs/plio/lib/python3.12/site-packages/plio/io/ControlNetFileV0002_pb2.py", line 34, in <module>
    _descriptor.EnumValueDescriptor(
  File "/opt/anaconda3/envs/plio/lib/python3.12/site-packages/google/protobuf/descriptor.py", line 920, in __new__
    _message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors cannot 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

I exited Python, ran conda install protobuf=3.20, and now it seems to be working -- or, at least, doesn't throw errors when I just run import plio. The version that was installed originally was 5.27.5. I haven't tested the rest of my code so I'm not sure if this relatively simple work-around solved things, but it's something to look into. Note that this is on an M1-chip Mac -- I've been migrating to arm-64 architecture for all my conda installs except ISIS to try to avoid the Rosetta 2 translation hit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant