Spotipy: Module Spotipy does not exist

Created on 11 Feb 2018  路  4Comments  路  Source: plamere/spotipy

`Traceback (most recent call last):
File "C:/Users/Tims/Documents/Python/ss.py", line 2, in
import spotipy
ModuleNotFoundError: No module named 'spotipy'

Its saying the module does not exist.... I didn't actually code this by the way, its just one of spotify's example s. import sys
import spotipy

if __name__ == '__main__':
max_tracks_per_call = 50
if len(sys.argv) > 1:
file = open(sys.argv[1])
else:
file = sys.stdin
tids = file.read().split()

sp = spotipy.Spotify()
for start in range(0, len(tids), max_tracks_per_call):
    results = sp.tracks(tids[start: start + max_tracks_per_call])
    for track in results['tracks']:
        print(track['name'] + ' - ' + track['artists'][0]['name'])

`

Most helpful comment

If using python3 make sure to run pip3 install spotipy

All 4 comments

Did you run pip install spotipy?

If using python3 make sure to run pip3 install spotipy

use pip install spotipy orpip3 install spotipy (if your system default python isn't python3)

you can check installed modules using pip freeze

I am pleased to notify you that the following command include both Python2 and Python3 environbment.

$ pip install spotipy

You do not need use the command $ pip3 install spotify. The command of $ pip3 that installs spotify is wrong and incurs the error of import spotipy while you use the Python3 environment.

Please see the spotipy details as follows.

spotipy: https://github.com/joohoi/spotipy/tree/python3

Was this page helpful?
0 / 5 - 0 ratings