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

WARNING: Application raises traceback error when used with certain Python versions #7

Closed
schlopp96 opened this issue Jun 12, 2022 Discussed in #6 · 0 comments
Closed
Assignees
Labels
bug Something isn't working important Crucial information relevant to the repository

Comments

@schlopp96
Copy link
Owner

schlopp96 commented Jun 12, 2022

The Issue

Hello!

So during development, after extensively testing V2Mp3, no problems were found when running the application locally in a dev environment.

However, when testing the application in a typical user environment, the following exception was returned upon running V2Mp3, causing the program to immediately close:

  • AttributeError: module 'typing' has no attribute '_ClassVar'. Did you mean: 'ClassVar'?

Full Traceback

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import V2Mp3
  File "C:\Python\lib\site-packages\V2Mp3\__init__.py", line 1, in <module>
    from .main import main as v2mp3
  File "C:\Python\lib\site-packages\V2Mp3\main.pyw", line 12, in <module>
    from V2Mp3.appEvents.events import _event_loop
  File "C:\Python\lib\site-packages\V2Mp3\appEvents\events.py", line 5, in <module>
    import moviepy.editor as mv
  File "C:\Python\lib\site-packages\moviepy\editor.py", line 24, in <module>
    import imageio
  File "C:\Python\lib\site-packages\imageio\__init__.py", line 24, in <module>
    from .core import FormatManager, RETURN_BYTES
  File "C:\Python\lib\site-packages\imageio\core\__init__.py", line 16, in <module>
    from .format import Format, FormatManager
  File "C:\Python\lib\site-packages\imageio\core\format.py", line 40, in <module>
    from ..config import known_plugins, known_extensions, PluginConfig, FileExtension
  File "C:\Python\lib\site-packages\imageio\config\__init__.py", line 7, in <module>
    from .plugins import known_plugins, PluginConfig
  File "C:\Python\lib\site-packages\imageio\config\plugins.py", line 3, in <module>
    from ..core.legacy_plugin_wrapper import LegacyPlugin
  File "C:\Python\lib\site-packages\imageio\core\legacy_plugin_wrapper.py", line 5, in <module>
    from .v3_plugin_api import PluginV3, ImageProperties
  File "C:\Python\lib\site-packages\imageio\core\v3_plugin_api.py", line 9, in <module>
    class ImageProperties:
  File "C:\Python\lib\site-packages\dataclasses.py", line 958, in dataclass
    return wrap(_cls)
  File "C:\Python\lib\site-packages\dataclasses.py", line 950, in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash, frozen)
  File "C:\Python\lib\site-packages\dataclasses.py", line 800, in _process_class
    cls_fields = [_get_field(cls, name, type)
  File "C:\Python\lib\site-packages\dataclasses.py", line 800, in <listcomp>
    cls_fields = [_get_field(cls, name, type)
  File "C:\Python\lib\site-packages\dataclasses.py", line 659, in _get_field
    if (_is_classvar(a_type, typing)
  File "C:\Python\lib\site-packages\dataclasses.py", line 550, in _is_classvar
    return type(a_type) is typing._ClassVar
AttributeError: module 'typing' has no attribute '_ClassVar'. Did you mean: 'ClassVar'?

Cause of Issue

  • This is apparently caused by an incompatibility with the dataclasses module and certain Python versions, such as Python 3.6> as first referenced here.

  • While never appearing in the V2Mp3 source code, the dataclasses module appears to be accessed by one of V2Mp3's dependencies, moviepy, which may explain why the exception occurs.

Workaround/Fix

Currently, the solution to this issue is to simply uninstall the dataclasses module if you are using Python 3.6 or above, as explained in this reply, and also here.

  • To fix this issue, enter the following command in your terminal/CLI:

      pip uninstall dataclasses -y
  • Once the workaround is applied, there should be no issues when running V2Mp3.

  • If any other workarounds or permanent fixes are found, I will update and list them accordingly.

@schlopp96 schlopp96 added bug Something isn't working important Crucial information relevant to the repository labels Jun 12, 2022
@schlopp96 schlopp96 self-assigned this Jun 12, 2022
@schlopp96 schlopp96 pinned this issue Jun 12, 2022
@schlopp96 schlopp96 reopened this Jun 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working important Crucial information relevant to the repository
Projects
None yet
Development

No branches or pull requests

1 participant