python pip の使い方

What it is?

pipオフィシャルサイト より

pip is a replacement for easy_install. It uses mostly the same techniques for finding packages, so packages that were made easy_installable should be pip-installable as well.
  • 大概のパッケージは /Library/Python/{PythonVersion}/site-packages にインストールされる
  • /System/Library/Frameworks/Python.framework/Versions/Current/Extras にも入ることがある

次のサイトも参考になりました。 MacWiki Python [pip] pip って何(・ω・ ) pipの使い方

Installation

$ sudo easy_install pip
Searching for pip
Reading http://pypi.python.org/simple/pip/
Reading http://pip.openplans.org
Reading http://www.pip-installer.org
Best match: pip 1.0.1
Downloading http://pypi.python.org/packages/source/p/pip/pip-1.0.1.tar.gz#md5=28dcc70225e5bf925532abc5b087a94b
Processing pip-1.0.1.tar.gz
Running pip-1.0.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-2LdU81/pip-1.0.1/egg-dist-tmp-_JEeQl
warning: no files found matching '*.html' under directory 'docs'
warning: no previously-included files matching '*.txt' found under directory 'docs/_build'
no previously-included directories found matching 'docs/_build/_sources'
Adding pip 1.0.1 to easy-install.pth file
Installing pip script to /usr/local/bin
Installing pip-2.6 script to /usr/local/bin

Installed /Library/Python/2.6/site-packages/pip-1.0.1-py2.6.egg
Processing dependencies for pip
Finished processing dependencies for pip

Usage

コマンド 内容
pip install SomePackage SomePackageをインストール
pip uninstall package-name package-nameを案インストール
pip install –upgrade foo fooをアップデート
pip install foo==1.0.4 fooの特定バージョンをインストール
pip search “query” queryを検索
pip freeze 自分の環境にインストールしてる package の一覧取得

pip で sphinx を install すると

$ pip install sphinx
Downloading/unpacking sphinx
  Downloading Sphinx-1.0.7.tar.gz (2.3Mb): 2.3Mb downloaded
  Running setup.py egg_info for package sphinx
    no previously-included directories found matching 'doc/_build'
Downloading/unpacking Pygments>=0.8 (from sphinx)
  Downloading Pygments-1.4.tar.gz (3.5Mb): 3.5Mb downloaded
  Running setup.py egg_info for package Pygments
Downloading/unpacking Jinja2>=2.2 (from sphinx)
  Downloading Jinja2-2.5.5.tar.gz (438Kb): 438Kb downloaded
  Running setup.py egg_info for package Jinja2
    warning: no previously-included files matching '*' found under directory 'docs/_build'
    warning: no previously-included files matching '*.pyc' found under directory 'jinja2'
    warning: no previously-included files matching '*.pyc' found under directory 'docs'
    warning: no previously-included files matching '*.pyo' found under directory 'jinja2'
    warning: no previously-included files matching '*.pyo' found under directory 'docs'
Downloading/unpacking docutils>=0.5 (from sphinx)
  Downloading docutils-0.7.tar.gz (1.4Mb): 1.4Mb downloaded
  Running setup.py egg_info for package docutils
    warning: no files found matching 'MANIFEST'
    warning: no previously-included files matching '.cvsignore' found under directory '*'
    warning: no previously-included files matching '*.pyc' found under directory '*'
    warning: no previously-included files matching '*~' found under directory '*'
    warning: no previously-included files matching '.DS_Store' found under directory '*'
Installing collected packages: sphinx, Pygments, Jinja2, docutils
  Running setup.py install for sphinx
    no previously-included directories found matching 'doc/_build'
    Installing sphinx-build script to /usr/local/bin
    Installing sphinx-quickstart script to /usr/local/bin
    Installing sphinx-autogen script to /usr/local/bin
  Running setup.py install for Pygments
    Installing pygmentize script to /usr/local/bin
  Running setup.py install for Jinja2
    warning: no previously-included files matching '*' found under directory 'docs/_build'
    warning: no previously-included files matching '*.pyc' found under directory 'jinja2'
    warning: no previously-included files matching '*.pyc' found under directory 'docs'
    warning: no previously-included files matching '*.pyo' found under directory 'jinja2'
    warning: no previously-included files matching '*.pyo' found under directory 'docs'
  Running setup.py install for docutils
    changing mode of build/scripts-2.6/rst2html.py from 644 to 755
    changing mode of build/scripts-2.6/rst2s5.py from 644 to 755
    changing mode of build/scripts-2.6/rst2latex.py from 644 to 755
    changing mode of build/scripts-2.6/rst2newlatex.py from 644 to 755
    changing mode of build/scripts-2.6/rst2man.py from 644 to 755
    changing mode of build/scripts-2.6/rst2xml.py from 644 to 755
    changing mode of build/scripts-2.6/rst2pseudoxml.py from 644 to 755
    changing mode of build/scripts-2.6/rstpep2html.py from 644 to 755
    changing mode of build/scripts-2.6/rst2odt.py from 644 to 755
    changing mode of build/scripts-2.6/rst2odt_prepstyles.py from 644 to 755
    warning: no files found matching 'MANIFEST'
    warning: no previously-included files matching '.cvsignore' found under directory '*'
    warning: no previously-included files matching '*.pyc' found under directory '*'
    warning: no previously-included files matching '*~' found under directory '*'
    warning: no previously-included files matching '.DS_Store' found under directory '*'
    changing mode of /usr/local/bin/rst2html.py to 755
    changing mode of /usr/local/bin/rst2latex.py to 755
    changing mode of /usr/local/bin/rst2man.py to 755
    changing mode of /usr/local/bin/rst2newlatex.py to 755
    changing mode of /usr/local/bin/rst2odt.py to 755
    changing mode of /usr/local/bin/rst2odt_prepstyles.py to 755
    changing mode of /usr/local/bin/rst2pseudoxml.py to 755
    changing mode of /usr/local/bin/rst2s5.py to 755
    changing mode of /usr/local/bin/rst2xml.py to 755
    changing mode of /usr/local/bin/rstpep2html.py to 755
Successfully installed sphinx Pygments Jinja2 docutils
Cleaning up...

Table Of Contents

Previous topic

homebrew の使い方

Next topic

homebrew と pip で sphinx-blockdiag Install

This Page