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

"Descriptors cannot not be created directly" #179

Closed
MatthewABrantley opened this issue Jun 9, 2022 · 5 comments
Closed

"Descriptors cannot not be created directly" #179

MatthewABrantley opened this issue Jun 9, 2022 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@MatthewABrantley
Copy link

MatthewABrantley commented Jun 9, 2022

I ran into this issue when installing requirements.txt into a python env.
protocolbuffers/protobuf#10051

I resolved it by adding:

protobuf==3.20.1

to requirements.txt, I have no idea if this is the correct fix, so not sending this as a PR.

@fangfufu
Copy link
Owner

fangfufu commented Jun 9, 2022

Does a newer version of protobuf work? Or does it have to be 3.20.1?

@fangfufu fangfufu added the bug Something isn't working label Jun 9, 2022
@fangfufu fangfufu self-assigned this Jun 9, 2022
@MatthewABrantley
Copy link
Author

No it doesn't seem like it. I changed it to 4.21.1 and got this error:

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).

@fangfufu
Copy link
Owner

Hmm interesting. But you are pinning it to 3.20.1. I will investigate further over the weekend.

@MatthewABrantley
Copy link
Author

I am pinning 3.20.1 because of the thread I linked, but I lack the understanding of why that worked or if there's a better solution.

@fangfufu
Copy link
Owner

fangfufu commented Jun 11, 2022

Thanks, fixed via 9cc3657

robjohn8989 added a commit to robjohn8989/Linux-Fake-Background-Webcam that referenced this issue Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants