easy_install

easy_install は Python のパッケージインストーラ、というかコマンドだ。Setuptools や Distribute に含まれている。で、ここがちょっと混乱するところなんだけど、Setuptools を使えばいいのか、それとも Distrubute を使うほうがいいのか、ってこと。Web の情報を見てみると、Setuptools は開発がとまっていて、そこから fork したのが Distribute らしい。

cf. エキPy読書会(第2期) 第1回に行ってきました – 今川館

というわけで、Distribute をインストールしてみた。

Distribute をインストールするには、次のURLからスクリプトをダウンロードして実行すればいい。

http://python-distribute.org/distribute_setup.py

^o^ > wget http://python-distribute.org/distribute_setup.py
^o^ > python distribute_setup.py

なんかいろいろとメッセージが出て、インストールが完了したらしい。
Pythonをインストールしたディレクトリの下にScripts\easy_install.exe というファイルができているので、ここにパスを通せばOK。
これで easy_install コマンドが使えるようになったはず。

^o^ > easy_install

ところが、いざ実行すると「ユーザーアカウント制御」というダイアログがでてきて、「はい」をクリックしても「いいえ」をクリックしてもそのまま終了してしまう。どうやら、Windows 7 のユーザー権限にひっかかっているらしい。どうすりゃいいんだ。

[追記]
どうもファイル名にinstallと入っているのが原因らしい。
cf. http://phpy.readthedocs.org/en/latest/install.html

次のようにすれば回避できるようだ。

^o^ > python -m easy_install
error: No urls, filenames, or requirements specified (see --help)

^o^ > python -m easy_install --help

Global options:
  --verbose (-v)  run verbosely (default)
  --quiet (-q)    run quietly (turns verbosity off)
  --dry-run (-n)  don't actually do anything
  --help (-h)     show detailed help message
  --no-user-cfg   ignore pydistutils.cfg in your home directory

Options for 'easy_install' command:
  --prefix                       installation prefix
  --zip-ok (-z)                  install package as a zipfile
  --multi-version (-m)           make apps have to require() a version
  --upgrade (-U)                 force upgrade (searches PyPI for latest
                                 versions)
  --install-dir (-d)             install package to DIR
  --script-dir (-s)              install scripts to DIR
  --exclude-scripts (-x)         Don't install scripts
  --always-copy (-a)             Copy all needed packages to install dir
  --index-url (-i)               base URL of Python Package Index
  --find-links (-f)              additional URL(s) to search for packages
  --delete-conflicting (-D)      no longer needed; don't use this
  --ignore-conflicts-at-my-risk  no longer needed; don't use this
  --build-directory (-b)         download/extract/build in DIR; keep the
                                 results
  --optimize (-O)                also compile with optimization: -O1 for
                                 "python -O", -O2 for "python -OO", and -O0 to
                                 disable [default: -O0]
  --record                       filename in which to record list of installed
                                 files
  --always-unzip (-Z)            don't install as a zipfile, no matter what
  --site-dirs (-S)               list of directories where .pth files work
  --editable (-e)                Install specified packages in editable form
  --no-deps (-N)                 don't install dependencies
  --allow-hosts (-H)             pattern(s) that hostnames must match
  --local-snapshots-ok (-l)      allow building eggs from local checkouts
  --version                      print version information and exit
  --no-find-links                Don't load find-links defined in packages
                                 being installed
  --user                         install in user site-package
                                 'C:\Users\takatoh\AppData\Roaming\Python\Python2
                                 7\site-packages'

usage: easy_install.py [options] requirement_or_url ...
   or: easy_install.py --help

「easy_install」への1件のフィードバック

  1. ピンバック: pip | blog.PanicBlanket.com

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください