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

beet web - ModuleNotFoundError on CORS import #2979

Closed
rveachkc opened this issue Jul 10, 2018 · 2 comments
Closed

beet web - ModuleNotFoundError on CORS import #2979

rveachkc opened this issue Jul 10, 2018 · 2 comments

Comments

@rveachkc
Copy link
Contributor

Problem

Running beet web in python 3.6.6 virtual environment leads to ModuleNotFoundError when CORS is enabled due to import on line 386 of beetsplug/web/init.py:

from flask.ext.cors import CORS

It works if I change this line to:

from flask_cors import CORS

Led to this problem:

(venv) user@host~/beets> beet -vv web
user configuration: /home/user/.config/beets/config.yaml
data directory: /home/user/.config/beets
plugin paths:
Sending event: pluginload
library database: /home/user/.config/beets/musiclibrary.db
library directory: /video/music_library/beets
Sending event: library_opened
web: Enabling CORS with origin: <hostname>
Traceback (most recent call last):
  File "/home/user/beets/venv/bin/beet", line 11, in <module>
    load_entry_point('beets==1.4.7', 'console_scripts', 'beet')()
  File "/home/user/beets/venv/lib/python3.6/site-packages/beets/ui/__init__.py", line 1256, in main
    _raw_main(args)
  File "/home/user/beets/venv/lib/python3.6/site-packages/beets/ui/__init__.py", line 1243, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/home/user/beets/venv/lib/python3.6/site-packages/beetsplug/web/__init__.py", line 386, in func
    from flask.ext.cors import CORS
ModuleNotFoundError: No module named 'flask.ext'

Setup

  • OS: Ubuntu 16.04
  • Python version: 3.6.6 virtual environment
  • beets version: 1.4.7
  • Turning off plugins made problem go away (yes/no): no
Package        Version
-------------- -------
beets          1.4.7
click          6.7
Flask          1.0.2
Flask-Cors     3.0.6
itsdangerous   0.24
jellyfish      0.6.1
Jinja2         2.10
MarkupSafe     1.0
munkres        1.0.12
musicbrainzngs 0.6
mutagen        1.40.0
pip            10.0.1
PyYAML         3.13
setuptools     39.0.1
six            1.11.0
Unidecode      1.0.22
Werkzeug       0.14.1

My configuration (output of beet config) is:

plugins: web smartplaylist web
directory: /video/music_library/beets/
library: /home/user/.config/beets/musiclibrary.db
import:
  move: yes
smartplaylist:
  relative_to: /video/music_library/beets/
  playlist_dir: /video/music_library/beet_playlists/
  playlists:
    - name: all.m3u
      query: ''
types:
  rating: int
web:
  host: 0.0.0.0
  cors: '<my hostname>'
@rveachkc
Copy link
Contributor Author

@rveachkc
Copy link
Contributor Author

Pull #2980

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

No branches or pull requests

1 participant