LoginSignup
11
11

More than 5 years have passed since last update.

Pythonローカル開発環境の構築その2(pyenv-virtualenv, pip使い方編)

Last updated at Posted at 2014-10-30

pyenv-virtualenvの使い方

virtualenv作成&設定

% pyenv versions
  system
  2.7.6
% pyenv virtualenv 2.7.6 test-env
% pyenv virtualenvs
  * test-env (created from $PYENV_ROOT/versions/2.7.6)
% pyenv activate test-env
% pyenv version
  * test-env (set by $PYENV_ROOT/versions/2.7.6)

virtualenv消去

% pyenv uninstall test-env
% pyenv virtualenvs
% pyenv versions

pipの使い方

パッケージをインストール

% pip install nose
% pip list
  nose (x.x.x)

インストールされているパッケージを保存(freeze)

% pip freeze > pip.list
% cat pip.list
  argparse==1.2.1
  configobj==5.0.6
  coverage==3.7.1
  logging==0.4.9.6
  mysql-connector-python==2.0.1
  nose==1.3.4
  six==1.8.0
  unittest-xml-reporting==1.9.2
  wsgiref==0.1.2

freezeしたパッケージをインストール

% pip install -r pip.list

パッケージのアンインストール

% pip uninstall nose
% pip list
11
11
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
11