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

Plugins don't work after reinstallation #3801

Closed
octaviospain opened this issue Nov 27, 2020 · 5 comments
Closed

Plugins don't work after reinstallation #3801

octaviospain opened this issue Nov 27, 2020 · 5 comments
Labels
needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature."

Comments

@octaviospain
Copy link

For some reason my beets installation gave me errors, so I removed it and installed it again. Wrong move.
Now, I get this output when running beets --version, either by installing it via pip or apt repository.

→ beet --version
** error loading plugin discogs:
Traceback (most recent call last):
  File "/home/kaord/.local/lib/python3.8/site-packages/beets/plugins.py", line 273, in load_plugins
    namespace = __import__(modname, None, None)
  File "/home/kaord/.local/lib/python3.8/site-packages/beetsplug/discogs.py", line 26, in <module>
    from discogs_client import Release, Master, Client
ModuleNotFoundError: No module named 'discogs_client'

** error loading plugin lastimport:
Traceback (most recent call last):
  File "/home/kaord/.local/lib/python3.8/site-packages/beets/plugins.py", line 273, in load_plugins
    namespace = __import__(modname, None, None)
  File "/home/kaord/.local/lib/python3.8/site-packages/beetsplug/lastimport.py", line 18, in <module>
    import pylast
ModuleNotFoundError: No module named 'pylast'

** error loading plugin check:
Traceback (most recent call last):
  File "/home/kaord/.local/lib/python3.8/site-packages/beets/plugins.py", line 273, in load_plugins
    namespace = __import__(modname, None, None)
ModuleNotFoundError: No module named 'beetsplug.check'

** error loading plugin wlg:
Traceback (most recent call last):
  File "/home/kaord/.local/lib/python3.8/site-packages/beets/plugins.py", line 273, in load_plugins
    namespace = __import__(modname, None, None)
  File "/usr/local/whatlastgenre/plugin/beets/beetsplug/wlg.py", line 28, in <module>
    from wlg import whatlastgenre
  File "/usr/local/whatlastgenre/plugin/beets/beetsplug/wlg.py", line 28, in <module>
    from wlg import whatlastgenre
ImportError: cannot import name 'whatlastgenre' from partially initialized module 'wlg' (most likely due to a circular import) (/usr/local/whatlastgenre/plugin/beets/beetsplug/wlg.py)

Traceback (most recent call last):
  File "/home/kaord/.local/bin/beet", line 8, in <module>
    sys.exit(main())
  File "/home/kaord/.local/lib/python3.8/site-packages/beets/ui/__init__.py", line 1266, in main
    _raw_main(args)
  File "/home/kaord/.local/lib/python3.8/site-packages/beets/ui/__init__.py", line 1249, in _raw_main
    subcommands, plugins, lib = _setup(options, lib)
  File "/home/kaord/.local/lib/python3.8/site-packages/beets/ui/__init__.py", line 1144, in _setup
    lib = _open_library(config)
  File "/home/kaord/.local/lib/python3.8/site-packages/beets/ui/__init__.py", line 1201, in _open_library
    get_path_formats(),
  File "/home/kaord/.local/lib/python3.8/site-packages/beets/ui/__init__.py", line 619, in get_path_formats
    path_formats.append((query, template(view.as_str())))
  File "/home/kaord/.local/lib/python3.8/site-packages/beets/util/functemplate.py", line 571, in template
    return Template(fmt)
  File "/home/kaord/.local/lib/python3.8/site-packages/beets/util/functemplate.py", line 581, in __init__
    self.compiled = self.translate()
  File "/home/kaord/.local/lib/python3.8/site-packages/beets/util/functemplate.py", line 614, in translate
    func = compile_func(
  File "/home/kaord/.local/lib/python3.8/site-packages/beets/util/functemplate.py", line 155, in compile_func
    prog = compile(mod, '<generated>', 'exec')
ValueError: Name node can't be used with 'None' constant→ beet --version
** error loading plugin discogs:
Traceback (most recent call last):
  File "/home/kaord/.local/lib/python3.8/site-packages/beets/plugins.py", line 273, in load_plugins
    namespace = __import__(modname, None, None)
  File "/home/kaord/.local/lib/python3.8/site-packages/beetsplug/discogs.py", line 26, in <module>
    from discogs_client import Release, Master, Client
ModuleNotFoundError: No module named 'discogs_client'

** error loading plugin lastimport:
Traceback (most recent call last):
  File "/home/kaord/.local/lib/python3.8/site-packages/beets/plugins.py", line 273, in load_plugins
    namespace = __import__(modname, None, None)
  File "/home/kaord/.local/lib/python3.8/site-packages/beetsplug/lastimport.py", line 18, in <module>
    import pylast
ModuleNotFoundError: No module named 'pylast'

** error loading plugin check:
Traceback (most recent call last):
  File "/home/kaord/.local/lib/python3.8/site-packages/beets/plugins.py", line 273, in load_plugins
    namespace = __import__(modname, None, None)
ModuleNotFoundError: No module named 'beetsplug.check'

** error loading plugin wlg:
Traceback (most recent call last):
  File "/home/kaord/.local/lib/python3.8/site-packages/beets/plugins.py", line 273, in load_plugins
    namespace = __import__(modname, None, None)
  File "/usr/local/whatlastgenre/plugin/beets/beetsplug/wlg.py", line 28, in <module>
    from wlg import whatlastgenre
  File "/usr/local/whatlastgenre/plugin/beets/beetsplug/wlg.py", line 28, in <module>
    from wlg import whatlastgenre
ImportError: cannot import name 'whatlastgenre' from partially initialized module 'wlg' (most likely due to a circular import) (/usr/local/whatlastgenre/plugin/beets/beetsplug/wlg.py)

Traceback (most recent call last):
  File "/home/kaord/.local/bin/beet", line 8, in <module>
    sys.exit(main())
  File "/home/kaord/.local/lib/python3.8/site-packages/beets/ui/__init__.py", line 1266, in main
    _raw_main(args)
  File "/home/kaord/.local/lib/python3.8/site-packages/beets/ui/__init__.py", line 1249, in _raw_main
    subcommands, plugins, lib = _setup(options, lib)
  File "/home/kaord/.local/lib/python3.8/site-packages/beets/ui/__init__.py", line 1144, in _setup
    lib = _open_library(config)
  File "/home/kaord/.local/lib/python3.8/site-packages/beets/ui/__init__.py", line 1201, in _open_library
    get_path_formats(),
  File "/home/kaord/.local/lib/python3.8/site-packages/beets/ui/__init__.py", line 619, in get_path_formats
    path_formats.append((query, template(view.as_str())))
  File "/home/kaord/.local/lib/python3.8/site-packages/beets/util/functemplate.py", line 571, in template
    return Template(fmt)
  File "/home/kaord/.local/lib/python3.8/site-packages/beets/util/functemplate.py", line 581, in __init__
    self.compiled = self.translate()
  File "/home/kaord/.local/lib/python3.8/site-packages/beets/util/functemplate.py", line 614, in translate
    func = compile_func(
  File "/home/kaord/.local/lib/python3.8/site-packages/beets/util/functemplate.py", line 155, in compile_func
    prog = compile(mod, '<generated>', 'exec')
ValueError: Name node can't be used with 'None' constant

Setup

  • OS: Ubuntu 20
  • Python version: 3.8.5
  • beets version: last one? can't check
  • Turning off plugins made problem go away (yes/no): no

My configuration (output of beet config) is:

irectory: ~/Music/Library/
library: ~/.config/beets/library.db

import:
  write: yes
  copy: no
  move: yes
  quiet_fallback: asis
  log: beets_import_log.log
  languages: en es
  detail: yes
  duplicate_action: ask
  bell: yes
  default_action: none
  set_fields:
    play_count: 0
    disc: 1
format_item: %if{$albumartist,$albumartist,$artist} - $album ($year) %if{$disc,$disc}/%if{$track,$track} %if{$albumartist,$artist }- $title $length %if{$genre,[$genre] }%if{$grouping,[$grouping] }%if{$bpm,[$bpm BPM] }%if{$play_count,[$play_count]}
format_album: $albumartist - $album ($year) %if{$genre,[$genre]}

sort_item: album+ disc+ track+ albumartist+ artist+
sort_album: albumartist+ year+ album+

paths:
  default: $albumartist/$album%aunique{}/$disc-$track $artist - $title
  singleton: $artist/$track $artist - $title
  comp: Compilations/$album%aunique{}/$disc-$track $artist - $title

pluginpath:
  /usr/local/whatlastgenre/plugin/beets/beetsplug
plugins: discogs lastimport fetchart embedart embyupdate play check wlg playlist

discogs:
  source_weight: 0.0
  user_token: <>
lastfm:
  user: <>
  api_key: <>
  per_page: 800
  retry_limit: 10
fetchart:
  sources: filesystem coverart itunes google *
  google_key: <>
embedart:
  ifempty: true
  maxwidth: 400
emby:
  emby: localhost
  port: 8096
  username: admin
  apikey: <>
play:
  command: /usr/bin/vlc
  use_folders: true
wlg:
  auto: yes
  force: no
  count: 4
  separator: ', '
  whitelist: wlg
playlist:
  auto: yes
  relative_to: ~/Music/Playlists
  playlist_dir: ~/Music/Playlists
@wisp3rwind
Copy link
Member

First of all, you're affected by this: #3674 which might have been your initial problem. Regarding actual plugin issues, you seem to be lacking some of the plugins' dependencies (discogs_client and so on), they need to be installed manually. The errors with beets.check and wlg (not sure about that the latter, I don't know this plugin, and I've not seen an error like this before) rather look like something is up with your installation. Maybe try removing wlg and the pluginpath configuration, I would guess that the issue is most likely with this manually installed plugin. See also #3752, #3752

@wisp3rwind wisp3rwind added the needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature." label Nov 28, 2020
@sampsyo
Copy link
Member

sampsyo commented Nov 28, 2020

FWIW, check and wlg (i.e., whatlastgenre) are both third-party plugins that need to be installed separately.

@octaviospain
Copy link
Author

Thanks for the quick answer. I've reinstalled python2, python3, and pip3, and removed wlg and beets-check plugins that caused trouble. Now I get this error message

# kaord at omen in ~ [20:40:59]
→ beet --version
Traceback (most recent call last):
  File "/home/kaord/.local/bin/beet", line 8, in <module>
    sys.exit(main())
  File "/home/kaord/.local/lib/python3.8/site-packages/beets/ui/__init__.py", line 1266, in main
    _raw_main(args)
  File "/home/kaord/.local/lib/python3.8/site-packages/beets/ui/__init__.py", line 1249, in _raw_main
    subcommands, plugins, lib = _setup(options, lib)
  File "/home/kaord/.local/lib/python3.8/site-packages/beets/ui/__init__.py", line 1144, in _setup
    lib = _open_library(config)
  File "/home/kaord/.local/lib/python3.8/site-packages/beets/ui/__init__.py", line 1201, in _open_library
    get_path_formats(),
  File "/home/kaord/.local/lib/python3.8/site-packages/beets/ui/__init__.py", line 619, in get_path_formats
    path_formats.append((query, template(view.as_str())))
  File "/home/kaord/.local/lib/python3.8/site-packages/beets/util/functemplate.py", line 571, in template
    return Template(fmt)
  File "/home/kaord/.local/lib/python3.8/site-packages/beets/util/functemplate.py", line 581, in __init__
    self.compiled = self.translate()
  File "/home/kaord/.local/lib/python3.8/site-packages/beets/util/functemplate.py", line 614, in translate
    func = compile_func(
  File "/home/kaord/.local/lib/python3.8/site-packages/beets/util/functemplate.py", line 155, in compile_func
    prog = compile(mod, '<generated>', 'exec')
ValueError: Name node can't be used with 'None' constant

@wisp3rwind
Copy link
Member

Please follow the link that I mentioned above: #3674. This is a known issue on recent versions of Python, unfortunately a fixed version of beets is not yet released.

@octaviospain
Copy link
Author

At the end, when I reinstalled, my Ubuntu machine was broken and never managed to log in again. Probably I accidentaly removed python system packages when trying to solve this, so when I reinstall the system I will have a fresh install, I hope I won't experience this problem or others then. Thanks anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature."
Projects
None yet
Development

No branches or pull requests

3 participants