Skip to content

TypeError: Descriptors cannot be created directly. #92

Description

@gaeldemarseille

PS C:\Users\Gael> votify "https://open.spotify.com/track/18gqCQzqYb0zvurQPlRkpo"
[INFO 03:17:18] Starting Votify 1.9.5
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in run_code
File "C:\Users\Gael\scoop\apps\python\current\Scripts\votify.exe_main
.py", line 6, in
sys.exit(main())
~~~~^^
File "C:\Users\Gael\AppData\Roaming\Python\Python314\site-packages\click\core.py", line 1485, in call
return self.main(*args, **kwargs)
~~~~~~~~~^^^^^^^^^^^^^^^^^
File "C:\Users\Gael\AppData\Roaming\Python\Python314\site-packages\click\core.py", line 1406, in main
rv = self.invoke(ctx)
File "C:\Users\Gael\AppData\Roaming\Python\Python314\site-packages\click\core.py", line 1269, in invoke
return ctx.invoke(self.callback, **ctx.params)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Gael\AppData\Roaming\Python\Python314\site-packages\click\core.py", line 824, in invoke
return callback(*args, **kwargs)
File "C:\Users\Gael\scoop\apps\python\current\Lib\site-packages\dataclass_click\dataclass_click.py", line 137, in wrapper
return func(*args, **kwargs)
File "C:\Users\Gael\scoop\apps\python\current\Lib\site-packages\votify\cli\config_file.py", line 165, in wrapper
return func(cli_config)
File "C:\Users\Gael\scoop\apps\python\current\Lib\site-packages\votify\cli\cli.py", line 43, in wrapper
return asyncio.run(func(*args, **kwargs))
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Gael\scoop\apps\python\current\Lib\asyncio\runners.py", line 204, in run
return runner.run(main)
~~~~~~~~~~^^^^^^
File "C:\Users\Gael\scoop\apps\python\current\Lib\asyncio\runners.py", line 127, in run
return self._loop.run_until_complete(task)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "C:\Users\Gael\scoop\apps\python\current\Lib\asyncio\base_events.py", line 719, in run_until_complete
return future.result()
~~~~~~~~~~~~~^^
File "C:\Users\Gael\scoop\apps\python\current\Lib\site-packages\votify\cli\cli.py", line 97, in main
api = await SpotifyApi.create_from_netscape_cookies(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<2 lines>...
)
^
File "C:\Users\Gael\scoop\apps\python\current\Lib\site-packages\votify\api\api.py", line 98, in create_from_netscape_cookies
return await cls.create(
^^^^^^^^^^^^^^^^^
...<3 lines>...
)
^
File "C:\Users\Gael\scoop\apps\python\current\Lib\site-packages\votify\api\api.py", line 112, in create
await api._initialize()
File "C:\Users\Gael\scoop\apps\python\current\Lib\site-packages\votify\api\api.py", line 118, in _initialize
await self._initialize_authorization()
File "C:\Users\Gael\scoop\apps\python\current\Lib\site-packages\votify\api\api.py", line 164, in _initialize_authorization
await asyncio.to_thread(self._initialize_librespot)
File "C:\Users\Gael\scoop\apps\python\current\Lib\asyncio\threads.py", line 25, in to_thread
return await loop.run_in_executor(None, func_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Gael\scoop\apps\python\current\Lib\concurrent\futures\thread.py", line 86, in run
result = ctx.run(self.task)
File "C:\Users\Gael\scoop\apps\python\current\Lib\concurrent\futures\thread.py", line 73, in run
return fn(*args, **kwargs)
File "C:\Users\Gael\scoop\apps\python\current\Lib\site-packages\votify\api\api.py", line 212, in initialize_librespot
from .librespot import Librespot
File "C:\Users\Gael\scoop\apps\python\current\Lib\site-packages\votify\api\librespot.py", line 1, in
from librespot.proto import Authentication_pb2 as Authentication
File "C:\Users\Gael\scoop\apps\python\current\Lib\site-packages\librespot_init
.py", line 3, in
from librespot.proto.Keyexchange_pb2 import BuildInfo, Platform, Product, ProductFlags
File "C:\Users\Gael\scoop\apps\python\current\Lib\site-packages\librespot\proto\Keyexchange_pb2.py", line 31, in
_descriptor.EnumValueDescriptor(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
name='PRODUCT_CLIENT',
^^^^^^^^^^^^^^^^^^^^^^
...<3 lines>...
type=None,
^^^^^^^^^^
create_key=_descriptor._internal_create_key),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Gael\scoop\apps\python\current\Lib\site-packages\google\protobuf\descriptor.py", line 1038, in new
_message.Message._CheckCalledFromGeneratedFile()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
TypeError: Descriptors cannot 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions