{"id":288,"hash":"422ecd90591b803b193e58b3a978aecfc1559b33d4f66b25abb23cff95af3f84","pattern":"TypeError: Descriptors cannot not be created directly","full_message":"I tried to install Ray, but it gave an error:\n\nTypeError: Descriptors cannot not be created directly.\nIf this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.\nIf you cannot immediately regenerate your protos, some other possible workarounds are:\n 1. Downgrade the protobuf package to 3.20.x or lower.\n 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).\n\nI tried to solve the problem and downgraded protobuf:\n\nName: protobuf\nVersion: 3.20.0\nSummary: Protocol Buffers\nHome-page: https://developers.google.com/protocol-buffers/\nAuthor:\nAuthor-email:\nLicense: BSD-3-Clause\nLocation: d:\\opencv\\lib\\site-packages\nRequires:\nRequired-by: ray, tensorboard, tensorflow\n\nBut still the problem persists in Ray, TensorFlow, and Keras. My application isn't working any more. How can I fix it?","ecosystem":"pypi","package_name":"tensorflow","package_version":null,"solution":"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.\n\nSolution 1:\nYou can downgrade the protobuf plugin,\n\npip install protobuf==3.20.*\n\nOr you can add it to the requirements.txt file as the last package. Because this will override the previously installed protobuf package.\n\n...\nprotobuf==3.20.*\n\nSolution 2:\nYou can set the following environment variable.\n\nexport PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python\n\naccording to the error description, this might impact your program performance.\n\nbut this will use pure-Python parsing and will be much slower\n\nReferences:\n\nTypeError: Descriptors cannot not be created directly\n[Python] Release 4.21.0 broke multiple Google Cloud client libraries (\"TypeError: Descriptors cannot not be created directly.\")","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/72441758/typeerror-descriptors-cannot-not-be-created-directly","votes":226,"created_at":"2026-04-19T04:41:46.110294+00:00","updated_at":"2026-04-19T04:51:57.732334+00:00"}