※こちらは旧サイトです(新サイトはこちら

virtualenvwrapperの使い方メモ

2016-10-31 21:22:55

virtualenvwrapperってあんまり使ってなかったけどちゃんと使ってみたメモ

コマンド一覧

基本的には、virtualenvのコマンドはそのまま使える模様

// 環境の一覧を見る
$ workon
local
hoge1
hoge2

// 環境に入る(virtualenvのactivateと同様)
$ workon hoge2
(hoge2) $

// 環境を抜ける
(hoge2) $ deactivate
$

// 環境を作る
$ mkvirtualenv --no-site-packages --python=/usr/bin/python2.7 hoge3
Running virtualenv with interpreter /usr/bin/python2.7
New python executable in /home/username/.virtualenvs/hoge3/bin/python2.7
Also creating executable in /home/username/.virtualenvs/hoge3/bin/python
Installing setuptools, pip, wheel...done.
virtualenvwrapper.user_scripts creating /home/username/.virtualenvs/hoge3/bin/predeactivate
virtualenvwrapper.user_scripts creating /home/username/.virtualenvs/hoge3/bin/postdeactivate
virtualenvwrapper.user_scripts creating /home/username/.virtualenvs/hoge3/bin/preactivate
virtualenvwrapper.user_scripts creating /home/username/.virtualenvs/hoge3/bin/postactivate
virtualenvwrapper.user_scripts creating /home/username/.virtualenvs/hoge3/bin/get_env_details
(hoge3) $

// 環境の削除
$ rmvirtualenv hoge3
Removing hoge3...