muammar / mkchromecast

Cast macOS and Linux Audio/Video to your Google Cast and Sonos Devices
http://mkchromecast.com
Other
2.21k stars 137 forks source link

TypeError: Descriptors cannot not be created directly. #442

Closed kurdtpage closed 8 months ago

kurdtpage commented 9 months ago

I have just installed mkchromecast version 0.3.9. I ran "mkchromecast -t" and this is the output:

WARNING: CPU random generator seem to be failing, disabling hardware random number generation
WARNING: RDRND generated: 0xffffffff 0xffffffff 0xffffffff 0xffffffff
Traceback (most recent call last):
  File "/usr/bin/mkchromecast", line 15, in <module>
    from mkchromecast.cast import Casting
  File "/usr/lib/python3/dist-packages/mkchromecast/cast.py", line 42, in <module>
    import pychromecast
  File "/usr/lib/python3/dist-packages/pychromecast/__init__.py", line 14, in <module>
    from . import socket_client
  File "/usr/lib/python3/dist-packages/pychromecast/socket_client.py", line 23, in <module>
    from . import cast_channel_pb2
  File "/usr/lib/python3/dist-packages/pychromecast/cast_channel_pb2.py", line 33, in <module>
    _descriptor.EnumValueDescriptor(
  File "/home/kurdtpage/.local/lib/python3.10/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).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
kurdtpage commented 9 months ago

Also, I am using Linux Mint 21.2 XFCE, I installed via apt

xsdg commented 8 months ago

This looks like an issue with the pychromecast package. The following stackoverflow answer suggests that updating that package should resolve the issue:

https://stackoverflow.com/a/77595451