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

Error in autobpm module (at least with Python 3.7) #5289

Open
cybersphinx opened this issue Jun 7, 2024 · 1 comment · May be fixed by #5322
Open

Error in autobpm module (at least with Python 3.7) #5289

cybersphinx opened this issue Jun 7, 2024 · 1 comment · May be fixed by #5322

Comments

@cybersphinx
Copy link

Problem

Trying to import an album with the new autobpm plugin, first I had to install librosa and resampy to get it to run, those dependencies should probably be documented.

Then it failed with:

Traceback (most recent call last):
  File "/home/user/bin/beet", line 8, in <module>
    sys.exit(main())
  File "/home/user/.local/pipx/venvs/beets2/lib/python3.7/site-packages/beets/ui/__init__.py", line 1865, in main
    _raw_main(args)
  File "/home/user/.local/pipx/venvs/beets2/lib/python3.7/site-packages/beets/ui/__init__.py", line 1852, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/home/user/.local/pipx/venvs/beets2/lib/python3.7/site-packages/beets/ui/commands.py", line 1395, in import_func
    import_files(lib, paths, query)
  File "/home/user/.local/pipx/venvs/beets2/lib/python3.7/site-packages/beets/ui/commands.py", line 1326, in import_files
    session.run()
  File "/home/user/.local/pipx/venvs/beets2/lib/python3.7/site-packages/beets/importer.py", line 360, in run
    pl.run_parallel(QUEUE_SIZE)
  File "/home/user/.local/pipx/venvs/beets2/lib/python3.7/site-packages/beets/util/pipeline.py", line 447, in run_parallel
    raise exc_info[1].with_traceback(exc_info[2])
  File "/home/user/.local/pipx/venvs/beets2/lib/python3.7/site-packages/beets/util/pipeline.py", line 312, in run
    out = self.coro.send(msg)
  File "/home/user/.local/pipx/venvs/beets2/lib/python3.7/site-packages/beets/util/pipeline.py", line 195, in coro
    func(*(args + (task,)))
  File "/home/user/.local/pipx/venvs/beets2/lib/python3.7/site-packages/beets/importer.py", line 1661, in plugin_stage
    func(session, task)
  File "/home/user/.local/pipx/venvs/beets2/lib/python3.7/site-packages/beets/plugins.py", line 143, in wrapper
    return func(*args, **kwargs)
  File "/home/user/.local/pipx/venvs/beets2/lib/python3.7/site-packages/beetsplug/autobpm.py", line 49, in imported
    self.calculate_bpm(task.imported_items())
  File "/home/user/.local/pipx/venvs/beets2/lib/python3.7/site-packages/beetsplug/autobpm.py", line 82, in calculate_bpm
    bpm = round(tempo)
TypeError: type numpy.ndarray doesn't define __round__ method

Adding an import numpy and changing the indicated line to bpm = numpy.round(tempo) fixed it here. Might just be a Python 3.7 problem, but the 2.0.0 release notes still claim Python 3.7 support.

Setup

  • OS: Debian 10.13
  • Python version: 3.7.3
  • beets version: 2.0.0
  • Turning off plugins made problem go away (yes/no): Fixing the plugin made the problem go away
tumbleboy added a commit to tumbleboy/beets that referenced this issue Jun 17, 2024
@tumbleboy
Copy link

Hey! I can create a pull request with the suggested change if it's suitable.

tumbleboy added a commit to tumbleboy/beets that referenced this issue Jun 18, 2024
@tumbleboy tumbleboy linked a pull request Jun 18, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants