LoginSignup
2
2

More than 5 years have passed since last update.

Python virtualenv で仮想環境に入って作業する。

Posted at

CentOSの上で、Pythonのバージョン 2.6.6
仮想環境で利用したいPythonバージョン 2.7.6

Python2.7.6のバイナリは、
/opt/local/bin/python2.7
とします。

仮想環境に入るとき

$python -V
Python 2.6.6

$mkvirtualenv --python=/opt/local/bin/python2.7 myvenv
Running virtualenv with interpreter /opt/local/bin/python2.7
New python executable in myvenv/bin/python2.7
Not overwriting existing python script myvenv/bin/python (you must use myvenv/bin/python2.7)
Installing setuptools, pip...done.

(myvenv)$python -V
Python 2.7.6

環境を抜けるとき

(myvenv)$deactivate

$python -V
Python 2.6.6
2
2
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
2
2