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

I get AttributeError: module 'google.protobuf.descriptor' has no attribute '_internal_create_key' #3

Closed
ndvbd opened this issue Jan 12, 2021 · 6 comments

Comments

@ndvbd
Copy link

ndvbd commented Jan 12, 2021

AttributeError: module 'google.protobuf.descriptor' has no attribute '_internal_create_key'

@scito
Copy link
Owner

scito commented Jan 15, 2021

I cannot reproduce this error.
Can you give from information? How to reproduce? Which environment? Python version? …

@stephenharris
Copy link

I had this too. Python 3.8.5. I had protobuf-3.6.1 installed, when I upgraded to 3.14.0 it worked. (See related: protocolbuffers/protobuf#7672)

@jmhunter
Copy link

jmhunter commented Feb 4, 2021

If it helps anyone else, I had this also.

I was running this in a fresh Ubuntu 20.04 installation, and had installed the protobuf package via the distribution's packaging system (sudo apt install python-protobuf)

Unfortunately the version of protobuf provided is too old (3.6.1.3-2ubuntu5, to be precise) and I didn't seem to have pip installed.

I'm not a Python expert yet, and not wishing to break my new desktop installation by going down a dependency rabbit-hole, I decided to use docker as I already had that installed.

Here's my one-liner that I used to get it working, this might help others too? This presumes the input file is in infile, in the current directory, where the software is also downloaded to.

$ cd /path/to/downloaded_script
$ docker run -it --rm --name extract_otp_secret_keys \
    -v "$PWD":/usr/src/myapp -w /usr/src/myapp \
    python:3 sh -c \
    "pip install protobuf; python extract_otp_secret_keys.py infile"

This will download the official Python3 docker image, install Protobuf via PIP, run the script and then exit, cleaning up after itself.

@scito
Copy link
Owner

scito commented Feb 7, 2021

It seems that an upgrade to protobuf 3.14.0 will solve this issue, see #3 (comment)
@ndvbd Could you fix the problem? Can I close this issue?

@ndvbd ndvbd closed this as completed Feb 7, 2021
@harry-appinfotech
Copy link

when running examples from "tests" DIr getting error no module named "extract_otp_secrets". Pls help

@scito
Copy link
Owner

scito commented Oct 27, 2023

@harry-appinfotech Please provide more information, to reproduce your case, e.g. versions, working directory, commands, ...

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

5 participants