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

Installing etcd3 #2242

Open
nijinjose123 opened this issue Aug 4, 2023 · 2 comments
Open

Installing etcd3 #2242

nijinjose123 opened this issue Aug 4, 2023 · 2 comments

Comments

@nijinjose123
Copy link

nijinjose123 commented Aug 4, 2023

Hi,
I installed the package from directly using pip install etcd3 and when I import the package, I get the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/pvw24040/ska_python/lib/python3.11/site-packages/etcd3/__init__.py", line 3, in <module>
    import etcd3.etcdrpc as etcdrpc
  File "/Users/pvw24040/ska_python/lib/python3.11/site-packages/etcd3/etcdrpc/__init__.py", line 1, in <module>
    from .rpc_pb2 import *
  File "/Users/pvw24040/ska_python/lib/python3.11/site-packages/etcd3/etcdrpc/rpc_pb2.py", line 16, in <module>
    from etcd3.etcdrpc import kv_pb2 as kv__pb2
  File "/Users/pvw24040/ska_python/lib/python3.11/site-packages/etcd3/etcdrpc/kv_pb2.py", line 33, in <module>
    _descriptor.EnumValueDescriptor(
  File "/Users/pvw24040/ska_python/lib/python3.11/site-packages/google/protobuf/descriptor.py", line 796, 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).

Could someone help me with this. I am not sure downgrading the protobuf is the best idea here.
I would have hoped it to be straight forward installation

@karthikdialpad
Copy link

Did you find a solution for this problem?
I too face this problem while importing.

@Alexey-NM
Copy link

Did you find a solution for this problem?

You can add the envirement variable:

export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python

But I think it would be better to get more fresh version of the library, you can add in requirements.txt

etcd3 @ git+https://github.com/kragniz/python-etcd3.git@e58a899579ba416449c4e225b61f039457c8072a

I have found some critical bugs in the current release( 0.12.0)

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

3 participants