Skip to content

Instantly share code, notes, and snippets.

@taisyo7333
Last active March 3, 2017 04:37
Show Gist options
  • Save taisyo7333/66fa12905f7a0aa6ca75feefa0182eda to your computer and use it in GitHub Desktop.
Save taisyo7333/66fa12905f7a0aa6ca75feefa0182eda to your computer and use it in GitHub Desktop.
pip install したらエラーになった件
brew install python
==> Installing dependencies for python: sqlite
==> Installing python dependency: sqlite
==> Downloading https://homebrew.bintray.com/bottles/sqlite-3.17.0.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring sqlite-3.17.0.el_capitan.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.
macOS provides an older sqlite3.
If you need to have this software first in your PATH run:
echo 'export PATH="/usr/local/opt/sqlite/bin:$PATH"' >> ~/.zshrc
For compilers to find this software you may need to set:
LDFLAGS: -L/usr/local/opt/sqlite/lib
CPPFLAGS: -I/usr/local/opt/sqlite/include
For pkg-config to find this software you may need to set:
PKG_CONFIG_PATH: /usr/local/opt/sqlite/lib/pkgconfig
==> Summary
🍺 /usr/local/Cellar/sqlite/3.17.0: 11 files, 2.9M
==> Installing python
==> Downloading https://homebrew.bintray.com/bottles/python-2.7.13.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring python-2.7.13.el_capitan.bottle.tar.gz
==> Using the sandbox
==> /usr/local/Cellar/python/2.7.13/bin/python -s setup.py --no-user-cfg install --force --verbose --single-version-externally-managed --record=installed.txt --install-scripts=/u
==> /usr/local/Cellar/python/2.7.13/bin/python -s setup.py --no-user-cfg install --force --verbose --single-version-externally-managed --record=installed.txt --install-scripts=/u
==> /usr/local/Cellar/python/2.7.13/bin/python -s setup.py --no-user-cfg install --force --verbose --single-version-externally-managed --record=installed.txt --install-scripts=/u
==> Caveats
Pip and setuptools have been installed. To update them
pip install --upgrade pip setuptools
You can install Python packages with
pip install <package>
They will install into the site-package directory
/usr/local/lib/python2.7/site-packages
See: http://docs.brew.sh/Homebrew-and-Python.html
==> Summary
🍺 /usr/local/Cellar/python/2.7.13: 3,526 files, 48M
> pip install docker docker-py;
Collecting docker
Using cached docker-2.1.0-py2.py3-none-any.whl
Requirement already satisfied: docker-py in /Users/d-inoue/Library/Python/2.7/lib/python/site-packages
Requirement already satisfied: requests!=2.11.0,!=2.12.2,>=2.5.2 in /Users/d-inoue/Library/Python/2.7/lib/python/site-packages (from docker)
Requirement already satisfied: backports.ssl-match-hostname>=3.5; python_version < "3.5" in /Users/d-inoue/Library/Python/2.7/lib/python/site-packages (from docker)
Collecting ipaddress>=1.0.16; python_version < "3.3" (from docker)
Using cached ipaddress-1.0.18-py2-none-any.whl
Collecting docker-pycreds>=0.2.1 (from docker)
Using cached docker_pycreds-0.2.1-py2.py3-none-any.whl
Requirement already satisfied: websocket-client>=0.32.0 in /Users/d-inoue/Library/Python/2.7/lib/python/site-packages (from docker)
Requirement already satisfied: six>=1.4.0 in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from docker)
Installing collected packages: ipaddress, docker-pycreds, docker
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 784, in install
**kwargs
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/Library/Python/2.7/site-packages/pip/wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "/Library/Python/2.7/site-packages/pip/wheel.py", line 323, in clobber
shutil.copyfile(srcfile, destfile)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 83, in copyfile
with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/ipaddress.py'
pip install --upgrade pip setuptools bugfix/guest_user_cant_purchase ✭ ✱
Requirement already up-to-date: pip in /usr/local/lib/python2.7/site-packages
Collecting setuptools
Downloading setuptools-34.3.1-py2.py3-none-any.whl (389kB)
100% |████████████████████████████████| 399kB 2.5MB/s
Requirement already up-to-date: six>=1.6.0 in /Users/d-inoue/Library/Python/2.7/lib/python/site-packages (from setuptools)
Collecting packaging>=16.8 (from setuptools)
Using cached packaging-16.8-py2.py3-none-any.whl
Collecting appdirs>=1.4.0 (from setuptools)
Downloading appdirs-1.4.2-py2.py3-none-any.whl
Collecting pyparsing (from packaging>=16.8->setuptools)
Using cached pyparsing-2.1.10-py2.py3-none-any.whl
Installing collected packages: pyparsing, packaging, appdirs, setuptools
Found existing installation: setuptools 33.1.1
Uninstalling setuptools-33.1.1:
Successfully uninstalled setuptools-33.1.1
Successfully installed appdirs-1.4.2 packaging-16.8 pyparsing-2.1.10 setuptools-34.3.1
❯ which pip
/usr/local/bin/pip
❯ pip install docker
Collecting docker
Using cached docker-2.1.0-py2.py3-none-any.whl
Collecting docker-pycreds>=0.2.1 (from docker)
Using cached docker_pycreds-0.2.1-py2.py3-none-any.whl
Requirement already satisfied: backports.ssl-match-hostname>=3.5; python_version < "3.5" in /Users/d-inoue/Library/Python/2.7/lib/python/site-packages (from docker)
Collecting ipaddress>=1.0.16; python_version < "3.3" (from docker)
Using cached ipaddress-1.0.18-py2-none-any.whl
Requirement already satisfied: requests!=2.11.0,!=2.12.2,>=2.5.2 in /Users/d-inoue/Library/Python/2.7/lib/python/site-packages (from docker)
Requirement already satisfied: six>=1.4.0 in /Users/d-inoue/Library/Python/2.7/lib/python/site-packages (from docker)
Requirement already satisfied: websocket-client>=0.32.0 in /Users/d-inoue/Library/Python/2.7/lib/python/site-packages (from docker)
Installing collected packages: docker-pycreds, ipaddress, docker
Successfully installed docker-2.1.0 docker-pycreds-0.2.1 ipaddress-1.0.18
@taisyo7333
Copy link
Author

systemにインストールされているpythonのバージョンが古いことが問題のようだ。

下記のコマンドでpythonをインストールすると問題なくpipが使えるようになる。

brew install python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment