Stampyy
Stampyy

Reputation: 11

Why do I keep getting a No Module Found: Spotipy error after installing it?

When I try to run a python program with Bash (Windows) I get the error "ModuleNotFoundError:No module named 'Spotipy'" Is there something I am doing wrong?

I have already tried installing the Spotipy packet using pip and easy install on Bash but I still get the error. I have also downloaded the packet on the file directory ,not sure if that makes a difference, still got the same error.

import os
import sys
import json
import spotipy
import webbrowser
import spotipy.util as util
from json.decoder import JSONDecodeError

#Get the username from terminal
username = sys.argv[1]

#Erase cahce and prompt for user permission
try:
    token = util.prompt_for_user_token(username)
except:
    os.remove(f".cache-{username}")
    token = util.prompt_for_user_token(username)

#Create spotifyObject
spotifyObject = spotipy.Spotify(auth=token)

This program is supposed to run on my terminal. Send me to a spotify login page then redirect me to a URL already set through a Spotify API.

Upvotes: 1

Views: 2182

Answers (1)

Abd El Kodous Souissi
Abd El Kodous Souissi

Reputation: 355

install it using git: git clone https://github.com/plamere/spotipy.git

then go to the directory of the package and run: python setup.py install

Upvotes: 1

Related Questions