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

Beets can't find any modules #3730

Closed
daviddavo opened this issue Aug 23, 2020 · 7 comments
Closed

Beets can't find any modules #3730

daviddavo opened this issue Aug 23, 2020 · 7 comments
Labels
needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature."

Comments

@daviddavo
Copy link

I installed beets using the beets package from manjaro repository and I get a lot of ModuleNotFound errors, even for things that are not plugins
https://www.archlinux.org/packages/community/any/beets/

The rest of the plugin dependencies where installed using pip3 --user, but they are in the path so they should be used if I'm using beets from my user

Problem

Running this command in verbose (-vv) mode:

$ beet -vv
user configuration: /home/davo/.config/beets/config.yaml
data directory: /home/davo/.config/beets
plugin paths:
** error loading plugin acousticbrainz:
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/beets/plugins.py", line 273, in load_plugins
    namespace = __import__(modname, None, None)
ModuleNotFoundError: No module named 'beetsplug.acousticbrainz'

** error loading plugin alternatives:
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/beets/plugins.py", line 273, in load_plugins
    namespace = __import__(modname, None, None)
  File "/home/davo/.local/lib/python3.8/site-packages/beetsplug/alternatives.py", line 27, in <module>
    from beetsplug import convert
ImportError: cannot import name 'convert' from 'beetsplug' (/home/davo/.local/lib/python3.8/site-packages/beetsplug/__init__.py)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Sending event: pluginload
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/beets/dbcore/db.py", line 972, in _make_table
    rows = tx.query('PRAGMA table_info(%s)' % table)
  File "/usr/lib/python3.8/site-packages/beets/dbcore/db.py", line 824, in query
    cursor = self.db._connection().execute(statement, subvals)
  File "/usr/lib/python3.8/site-packages/beets/dbcore/db.py", line 899, in _connection
    conn = self._create_connection()
  File "/usr/lib/python3.8/site-packages/beets/library.py", line 1319, in _create_connection
    conn = super(Library, self)._create_connection()
  File "/usr/lib/python3.8/site-packages/beets/dbcore/db.py", line 913, in _create_connection
    conn = sqlite3.connect(
sqlite3.OperationalError: unable to open database file

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/beets/ui/__init__.py", line 1198, in _open_library
    lib = library.Library(
  File "/usr/lib/python3.8/site-packages/beets/library.py", line 1310, in __init__
    super(Library, self).__init__(path, timeout=timeout)
  File "/usr/lib/python3.8/site-packages/beets/dbcore/db.py", line 885, in __init__
    self._make_table(model_cls._table, model_cls._fields)
  File "/usr/lib/python3.8/site-packages/beets/dbcore/db.py", line 972, in _make_table
    rows = tx.query('PRAGMA table_info(%s)' % table)
  File "/usr/lib/python3.8/site-packages/beets/dbcore/db.py", line 817, in __exit__
    self.db._connection().commit()
  File "/usr/lib/python3.8/site-packages/beets/dbcore/db.py", line 899, in _connection
    conn = self._create_connection()
  File "/usr/lib/python3.8/site-packages/beets/library.py", line 1319, in _create_connection
    conn = super(Library, self)._create_connection()
  File "/usr/lib/python3.8/site-packages/beets/dbcore/db.py", line 913, in _create_connection
    conn = sqlite3.connect(
sqlite3.OperationalError: unable to open database file

error: database file /home/davo/Música/library.db cannot not be opened: unable to open database file

Setup

  • OS: Manjaro
  • Python version: 3.8.5
  • beets version: 1.4.9-4
  • Turning off plugins made problem go away (yes/no): yes

My configuration (output of beet config) is:

library: ~/Music/library.db
directory: ~/Music
ignore: $*

import:
    move: yes
    write: yes
    resume: ask
    log: imports.log
threaded: yes

format_item: $artist - $album ($original_year) - $title
format_album: $albumartist - $album ($original_year)
va_name: Various Artists

clutter:
- Thumbs.DB
- .DS_Store
- '*.url'
- '*.log'
- '*.torrent'

ui:
    color: yes

paths:
    classical:true: 00Classical/$album_composer - $album/$track - $title
    default: $albumartist - $album (%if{$original_year,$original_year,$year})%aunique{}/$track - $title
    singleton: 00Non-Album/$artist - $title %if{$original_year, ($original_year)}
    albumtype:soundtrack: 00Soundtracks/$album ($year)/$track - $title
    comp: 00Compilations/$album ($year)/$track - $title
album_fields:
    album_composer: "d = dict()\nfor item in items:\n    if item.composer not in d.keys():\n        d[item.composer] = 1\n    else:\n        d[item.composer] += 1\nreturn max(d, key=d.get)\n"
edit:
    itemfields:
    - track
    - title
    - artist
    - album
    - year
    albumfields: [album, albumartist, year]
chroma:
    auto: yes
acousticbrainz:
    auto: yes
    force: no
acoustid:
    apikey: LuGCOBdbkF
embedart:
    auto: yes
    compare_threshold: 70
    ifempty: no
    remove_art_file: no
importadded:
    preserve_mtimes: yes
lastgenre:
    auto: yes
    count: 3
    fallback: ''
    force: yes
    min_weight: 15
    prefer_specific: no
    source: track
    separator: ', '
    whitelist: yes
mpd:
    rating: yes
    music_directory: "~/M\xFAsica"
badfiles:
    commands:
        flac: flac --test --warnings-as-errors --silent
playlist:
    auto: yes
    relative_to: "~/M\xFAsica"
    playlist_dir: "~/M\xFAsica/Playlists"
smartplaylist:
    relative_to: "~/M\xFAsica"
    playlist_dir: "~/M\xFAsica/Playlists"
    playlists: [{name: Blues Collection.m3u, query: 'genre:blues'}, {name: Chillhop Collection.m3u, query: 'genre:chillhop'}]
play:
    relative_to: "~/M\xFAsica"
    command: mpc add
    raw: yes
include: [musicbrainz.yaml]
alternatives:
    android:
        directory: ../MovilMusica
        query: onplayer:true, singleton:true, onplaylist:true
        formats: link
        link_type: relative
hook:
    hooks: [{event: import, command: beet alt update android}]
@sampsyo sampsyo added the needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature." label Aug 23, 2020
@sampsyo
Copy link
Member

sampsyo commented Aug 23, 2020

Huh! It's really hard to tell what has gone wrong with this installation—could some files have gotten deleted? Is something strange about the filesystem it's using?

You might try installing beets from pip instead of the Manjaro repositories to see if that works.

@ybnd
Copy link
Contributor

ybnd commented Aug 30, 2020

Did you try specifying the plugin path in the configuration? e.g.:

pluginpath:
    - ~/.local/lib/python3.8/site-packages/beetsplug

Without this, I can't use plugins installed with pip install --user ... either.

@daviddavo
Copy link
Author

Yes, the problem is that it doesn't seem to use the $PYTHONPATH environment variable, but changing where the plugins are located in the config solved the issue!

@tobek
Copy link

tobek commented Oct 8, 2020

A note that the same thing happened to me, but when I checked ~/.local/lib/python3.8/site-packages/beetsplug the only things there were some manually installed plugins, all the default ones were missing, so setting pluginpath in config didn't help. No idea how they went missing.

I was able to fix by uninstalling and reinstalling beets (nothing is lost during reinstall) using (in my case) pip.

@ybnd
Copy link
Contributor

ybnd commented Oct 9, 2020

I think that's to be expected if you installed via pacman. Then beets and beetsplug should be in /lib/python3.8/site-packages.

But you couldn't load the default plugins either? If so, that's very weird...

@tobek
Copy link

tobek commented Oct 9, 2020

Aha I did originally install via pacman but went looking in ~/.local/lib/ after seeing this thread, didn't know pacman would have put them in /lib/python3.8/ (or /usr/lib/python3.8/) but that makes more sense in retrospect. I have since uninstalled via pacman and installed via pip instead so I can't debug but yeah, default plugins were not loading for me, exact same error messages as OP.

@ybnd
Copy link
Contributor

ybnd commented Oct 10, 2020

Strange, I wouldn't even know how to replicate that... If you ever find yourself reinstalling from pacman and come across the same issue I'd want to look at your config & logs for sure. That should probably be in a new issue though.

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

4 participants