Skip to content

Commit

Permalink
Change flask_cors import name for support with pyinstaller
Browse files Browse the repository at this point in the history
  • Loading branch information
Fornoth committed Apr 2, 2016
1 parent ec0638c commit b95bda2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import re
from flask import Flask, request, abort, jsonify, render_template, redirect, flash, url_for
from flask_bootstrap import Bootstrap
from flask.ext.cors import CORS
from flask_cors import CORS
from gevent.wsgi import WSGIServer
from gevent import spawn_later, sleep
from connect_ffi import ffi, lib
Expand Down

5 comments on commit b95bda2

@whumann
Copy link

@whumann whumann commented on b95bda2 Apr 3, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried this because I had the problems mentioned in http://powerpi.de/spotify-connect-auf-dem-raspberry-pi-2-installieren-dein-smartphone-ist-die-fernbedienung/comment-page-2/#comment-209395
Now I get:

    Traceback (most recent call last):
      File "main.py", line 10, in <module>
        from flask_cors import CORS
    ImportError: No module named flask_cors

I'm on Raspbian Jessie and according to pip list I have:
Flask (0.10.1)
Flask-Bootstrap (3.3.5.7)
Flask-Cors (2.1.2)

@Fornoth
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@whumann Are you using the chroot? If show, run pip list inside the chroot, because the command should be showing more than that

@whumann
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm running sudo /root/spotify-connect-web.sh... -- that's using chroot, isn't it? My pip list is much longer (but doesn't seem to depend on whether I'm pi or root...) but just listed the ones that have 'Flask' in their name. I imagined, others might not be relevant for that error. The complete list is:
argparse (1.2.1)
blinker (1.3)
cffi (1.1.2)
chardet (2.3.0)
colorama (0.3.2)
dominate (2.2.0)
Flask (0.10.1)
Flask-Bootstrap (3.3.5.7)
Flask-Cors (2.1.2)
gevent (1.0.1)
greenlet (0.4.2)
html5lib (0.999)
itsdangerous (0.24)
Jinja2 (2.8)
MarkupSafe (0.23)
Mopidy (2.0.0)
Mopidy-Moped (0.6.4)
Mopidy-Spotify (3.0.0)
Mopidy-Spotify-Tunigo (1.0.0)
MySQL-python (1.2.3)
ndg-httpsclient (0.3.2)
pip (1.5.6)
ply (3.4)
pyalsaaudio (0.8.2)
pyasn1 (0.1.7)
pycparser (2.10)
pycurl (7.19.5)
pygobject (3.14.0)
pyinotify (0.9.4)
Pykka (1.2.0)
pyOpenSSL (0.13.1)
pyspotify (2.0.5)
requests (2.4.3)
RPi.GPIO (0.6.2)
setuptools (5.5.1)
six (1.10.0)
tornado (3.2.2)
tunigo (1.0.0)
urllib3 (1.9.1)
visitor (0.1.2)
Werkzeug (0.11.5)
wheel (0.24.0)
wsgiref (0.1.2)

@joe-average
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Stuck with the same error...

@Fornoth
Copy link
Owner Author

@Fornoth Fornoth commented on b95bda2 Jul 3, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try using flask.ext.cors instead of flask_cors, and see if that helps

Please sign in to comment.