[GH-ISSUE #238] Fails to install on macOS #124

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

Originally created by @foxt on GitHub (Dec 10, 2017).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/238

Collecting spotipy
  Using cached spotipy-2.4.4.tar.gz
Requirement already satisfied: requests>=1.0 in /Library/Python/2.7/site-packages (from spotipy)
Requirement already satisfied: idna<2.7,>=2.5 in /Library/Python/2.7/site-packages (from requests>=1.0->spotipy)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in /Library/Python/2.7/site-packages (from requests>=1.0->spotipy)
Requirement already satisfied: certifi>=2017.4.17 in /Library/Python/2.7/site-packages (from requests>=1.0->spotipy)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /Library/Python/2.7/site-packages (from requests>=1.0->spotipy)
Installing collected packages: spotipy
  Running setup.py install for spotipy ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/ff/g76q7vv54q58ygbnlrchxcqc0000gn/T/pip-build-5uqTwz/spotipy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/ff/g76q7vv54q58ygbnlrchxcqc0000gn/T/pip-QL1tzu-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib
    creating build/lib/spotipy
    copying spotipy/__init__.py -> build/lib/spotipy
    copying spotipy/client.py -> build/lib/spotipy
    copying spotipy/oauth2.py -> build/lib/spotipy
    copying spotipy/util.py -> build/lib/spotipy
    running install_lib
    creating /Library/Python/2.7/site-packages/spotipy
    error: could not create '/Library/Python/2.7/site-packages/spotipy': Permission denied

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/ff/g76q7vv54q58ygbnlrchxcqc0000gn/T/pip-build-5uqTwz/spotipy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/ff/g76q7vv54q58ygbnlrchxcqc0000gn/T/pip-QL1tzu-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1in /private/var/folders/ff/g76q7vv54q58ygbnlrchxcqc0000gn/T/pip-build-5uqTwz/spotipy/```
Originally created by @foxt on GitHub (Dec 10, 2017). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/238 ```Leos-iMac:PlayMusicOnSpotify thelmgn$ pip install spotipy Collecting spotipy Using cached spotipy-2.4.4.tar.gz Requirement already satisfied: requests>=1.0 in /Library/Python/2.7/site-packages (from spotipy) Requirement already satisfied: idna<2.7,>=2.5 in /Library/Python/2.7/site-packages (from requests>=1.0->spotipy) Requirement already satisfied: urllib3<1.23,>=1.21.1 in /Library/Python/2.7/site-packages (from requests>=1.0->spotipy) Requirement already satisfied: certifi>=2017.4.17 in /Library/Python/2.7/site-packages (from requests>=1.0->spotipy) Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /Library/Python/2.7/site-packages (from requests>=1.0->spotipy) Installing collected packages: spotipy Running setup.py install for spotipy ... error Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/ff/g76q7vv54q58ygbnlrchxcqc0000gn/T/pip-build-5uqTwz/spotipy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/ff/g76q7vv54q58ygbnlrchxcqc0000gn/T/pip-QL1tzu-record/install-record.txt --single-version-externally-managed --compile: running install running build running build_py creating build creating build/lib creating build/lib/spotipy copying spotipy/__init__.py -> build/lib/spotipy copying spotipy/client.py -> build/lib/spotipy copying spotipy/oauth2.py -> build/lib/spotipy copying spotipy/util.py -> build/lib/spotipy running install_lib creating /Library/Python/2.7/site-packages/spotipy error: could not create '/Library/Python/2.7/site-packages/spotipy': Permission denied ---------------------------------------- Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/ff/g76q7vv54q58ygbnlrchxcqc0000gn/T/pip-build-5uqTwz/spotipy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/ff/g76q7vv54q58ygbnlrchxcqc0000gn/T/pip-QL1tzu-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1in /private/var/folders/ff/g76q7vv54q58ygbnlrchxcqc0000gn/T/pip-build-5uqTwz/spotipy/```
kerem closed this issue 2026-02-27 23:20:57 +03:00
Author
Owner

@gawaineo commented on GitHub (Dec 15, 2017):

By the looks of your error message try using sudo pip install spotipy. Use sudo to grant root permission.

BEST PRACTICE below:
Try using a virtualenv to install the library to isolate your dependencies. Feel free to update us on the results.

Install: pip install virtualenv
Create: virtualenv <virtualenv name>
Activate: source <virtualenv name>/bin/activate

Now install spotipy after that virtualenv has been activated.

<!-- gh-comment-id:352080370 --> @gawaineo commented on GitHub (Dec 15, 2017): By the looks of your error message try using `sudo pip install spotipy`. Use `sudo` to grant root permission. **BEST PRACTICE below:** Try using a virtualenv to install the library to isolate your dependencies. Feel free to update us on the results. Install: `pip install virtualenv` Create: `virtualenv <virtualenv name>` Activate: `source <virtualenv name>/bin/activate` Now install spotipy after that virtualenv has been activated.
Author
Owner

@ufukomer commented on GitHub (Mar 17, 2019):

@gawaineo yes it works.

<!-- gh-comment-id:473653959 --> @ufukomer commented on GitHub (Mar 17, 2019): @gawaineo yes it works.
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#124
No description provided.