TypeError: Descriptors cannot not be created directly
I tried to install Ray, but it gave an 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). I tried to solve the problem and downgraded protobuf: Name: protobuf Version: 3.20.0 Summary: Protocol Buffers Home-page: https://developers.google.com/protocol-buffers/ Author: Author-email: License: BSD-3-Clause Location: d:\opencv\lib\site-packages Requires: Required-by: ray, tensorboard, tensorflow But still the problem persists in Ray, TensorFlow, and Keras. My application isn't working any more. How can I fix it?
Sometimes the protobuf package might be installed without your involvement. For this, you have two solutions to apply. Try one of the below solutions and it should work. Solution 1: You can downgrade the protobuf plugin, pip install protobuf==3.20.* Or you can add it to the requirements.txt file as the last package. Because this will override the previously installed protobuf package. ... protobuf==3.20.* Solution 2: You can set the following environment variable. export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python according to the error description, this might impact your program performance. but this will use pure-Python parsing and will be much slower References: TypeError: Descriptors cannot not be created directly [Python] Release 4.21.0 broke multiple Google Cloud client libraries ("TypeError: Descriptors cannot not be created directly.")
Get this solution programmatically \u2014 free, no authentication.
curl https://depscope.dev/api/error/422ecd90591b803b193e58b3a978aecfc1559b33d4f66b25abb23cff95af3f84