โ09-10-2022 11:40 PM
hello everyone, I'm trying use spotify's api to analyse my music data, but i'm receiving a error during authentication, specifically when I try get the token, above my code.
Is it a databricks bug?
pip install spotipy
from spotipy.oauth2 import SpotifyOAuth
from spotipy.oauth2 import SpotifyClientCredentials
import spotipy
import spotipy.util as util
sp = spotipy.oauth2.SpotifyOAuth(client_id='client_id
,client_secret='client_secret
,redirect_uri='http://localhost:8080/callback/'
,requests_timeout=5, open_browser=False)
sp.get_access_token()
error:
StdinNotImplementedError: raw_input was called, but this frontend does not support input requests.
โ01-09-2025 03:28 AM
If you need any further help you can ping me.
โ07-29-2025 09:13 PM
Hi Alex,
You're definitely not alone โ this is a common issue when using the Spotify API in environments like Databricks or Jupyter Notebooks, where user input through the console (like typing in a prompt) isn't supported.
What's happening is that the authentication process is trying to ask you for input, such as pasting in a URL or login info, but Databricks doesnโt allow that kind of interaction. Thatโs why youโre seeing the StdinNotImplementedError.
Hereโs what you can do:
If you're trying to access your personal Spotify data (like playlists, saved tracks, or recently played songs), youโll need to do the authentication on your local machine where input prompts and browser login work normally. Once you get the access token there, you can copy it and use it in Databricks.
If you only need public data (like artist info, album details, or general song metadata), you can use a simpler method called the Client Credentials Flow. This doesn't require user login and works well in Databricks โ but it wonโt give you access to your personal listening data.
In short: Databricks canโt handle login prompts, so you either need to do the login part outside of it, or stick to public data.
Let me know what kind of Spotify Premium data you're aiming to analyze, and I can help you choose the best route!
โ08-11-2025 04:05 AM
If youโve already verified your OAuth process and backend token handling, sometimes building a quick test app to simulate API calls helps pinpoint formatting issues with the raw input. Iโve run into similar troubleshooting scenarios while working on automation for a 3D printing workflow at the key was isolating the request/response cycle to identify where the formatting broke down.
โ08-11-2025 04:11 AM
If isolating the request/response cycle isnโt revealing the issue, it might be worth running the same token request through a completely different environment (like a lightweight cloud function) to see if the problem persists outside your current setup. Iโve had similar debugging steps save a lot of time when integrating APIs into unrelated automation systems even in areas like retirement planning simulador jubilacion at where precise request formatting is critical for accurate outputs.
2 weeks ago
Thank for information
2 weeks ago
Thank you
Passionate about hosting events and connecting people? Help us grow a vibrant local communityโsign up today to get started!
Sign Up Now