[GH-ISSUE #634] AttributeError: module 'spotipy' has no attribute 'cache_handler' #376

Closed
opened 2026-02-27 23:22:18 +03:00 by kerem · 2 comments
Owner

Originally created by @babo-hias on GitHub (Jan 20, 2021).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/634

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!

Originally created by @babo-hias on GitHub (Jan 20, 2021). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/634 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_functions[rule.endpoint](**req.view_args) 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!
kerem 2026-02-27 23:22:18 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@stephanebruckert commented on GitHub (Jan 20, 2021):

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

<!-- gh-comment-id:763726059 --> @stephanebruckert commented on GitHub (Jan 20, 2021): @babo-hias use the 2.16.1 version of the example https://github.com/plamere/spotipy/blob/2.16.1/examples/app.py
Author
Owner

@babo-hias commented on GitHub (Jan 20, 2021):

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

<!-- gh-comment-id:763791618 --> @babo-hias commented on GitHub (Jan 20, 2021): Thanks for your quick reply! Now it is working. Thanks a lot!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotipy#376
No description provided.