[GH-ISSUE #784] How to change location of .cache? (Reading or writing) #484

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

Originally created by @clemwo on GitHub (Feb 22, 2022).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/784

Hi, I wrote a little command line interface that can be used to merge playlists. Code can be found here:
https://gitlab.com/clemwo/spotify-playlist-merger

I used setuptools for installation and click to make the cli.

Now when I run the script in the terminal in the folder where it is installed at ~/.local/share/SpotifyPM everything works fine. However if I execute the command from another place such as my home directory I get the followinge message:
Couldn't read cache at: .cache
The error isn't surprising because apparently spotipy looks for the .cache file in the current working directory (this is just my assumption).
How can I make spotipy look for the .cache file in another place? I have used platformdirs to generate a config file in the user data location so it would be nice if that could also be the location where I save the .cache.

Thanks for any help and for the great library!

Originally created by @clemwo on GitHub (Feb 22, 2022). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/784 Hi, I wrote a little command line interface that can be used to merge playlists. Code can be found here: https://gitlab.com/clemwo/spotify-playlist-merger I used setuptools for installation and click to make the cli. Now when I run the script in the terminal in the folder where it is installed at ``~/.local/share/SpotifyPM`` everything works fine. However if I execute the command from another place such as my home directory I get the followinge message: ``Couldn't read cache at: .cache`` The error isn't surprising because apparently spotipy looks for the .cache file in the current working directory (this is just my assumption). How can I make spotipy look for the .cache file in another place? I have used [platformdirs](https://pypi.org/project/platformdirs/) to generate a config file in the user data location so it would be nice if that could also be the location where I save the .cache. Thanks for any help and for the great library!
kerem 2026-02-27 23:22:53 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@Peter-Schorn commented on GitHub (Feb 23, 2022):

You can specify an absolute path for where the authorization information should be stored, as described here.

<!-- gh-comment-id:1048362074 --> @Peter-Schorn commented on GitHub (Feb 23, 2022): You can specify an absolute path for where the authorization information should be stored, as described [here](https://github.com/plamere/spotipy/issues/712#issuecomment-1048360819).
Author
Owner

@dieser-niko commented on GitHub (May 21, 2024):

Closing as the issue seems to be resolved.

<!-- gh-comment-id:2123475256 --> @dieser-niko commented on GitHub (May 21, 2024): Closing as the issue seems to be resolved.
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#484
No description provided.