spotipy-dev / spotipy

A light weight Python library for the Spotify Web API
http://spotipy.readthedocs.org
MIT License
5.02k stars 960 forks source link

AttributeError: module 'spotipy' has no attribute 'cache_handler' #634

Closed babo-hias closed 3 years ago

babo-hias commented 3 years ago

I am getting the following error, when I want to run the "master/examples/app.py" (unchanged code, just cloned it from Github):

ERROR in app: Exception on / [GET] Traceback (most recent call last): File "...\AppData\Local\Programs\Python\Python38\lib\site-packages\flask\app.py", line 2447, in wsgi_app response = self.full_dispatch_request() File "...\AppData\Local\Programs\Python\Python38\lib\site-packages\flask\app.py", line 1952, in full_dispatch_request rv = self.handle_user_exception(e) File "...\AppData\Local\Programs\Python\Python38\lib\site-packages\flask\app.py", line 1821, in handle_user_exception reraise(exc_type, exc_value, tb) File "...\AppData\Local\Programs\Python\Python38\lib\site-packages\flask_compat.py", line 39, in reraise raise value File "...\AppData\Local\Programs\Python\Python38\lib\site-packages\flask\app.py", line 1950, in full_dispatch_request rv = self.dispatch_request() File "...\AppData\Local\Programs\Python\Python38\lib\site-packages\flask\app.py", line 1936, in dispatch_request return self.view_functionsrule.endpoint File ".../app.py", line 51, in index cache_handler = spotipy.cache_handler.CacheFileHandler(cache_path=session_cache_path()) AttributeError: module 'spotipy' has no attribute 'cache_handler'

It seems that he is missing the cache_handler. Did I forget something obvious, that I have to execute, before I can use the "master/examples/app.py" code? I am using Spotipy v2.16.1 and installed all required libs.

Thanks in advance for your help!

stephanebruckert commented 3 years ago

@babo-hias use the 2.16.1 version of the example https://github.com/plamere/spotipy/blob/2.16.1/examples/app.py

babo-hias commented 3 years ago

Thanks for your quick reply! Now it is working. Thanks a lot!