0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Debian 10 (buster) のpython3でmkvirtualenvを使う

Last updated at Posted at 2020-03-14

準備する

aptでpipとvirtualenvをインストールする。

$ apt-get install python3-pip python3-virtualenv

pipでvirtualenvwrapperをインストールする。~/.local/bin/配下にインストールされる。python3用のvirtualenvwrapperのdebianパッケージはない。

$ pip3 install virtualenvwrapper

以下を~/.bashrcに追加し、一度ログアウトする。

~/.bashrc
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/devel
export VIRTUALENV_PYTHON=/usr/bin/python3
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/bin/virtualenv
source ~/.local/bin/virtualenvwrapper.sh

利用する

再度ログイン後、mkvirtualenvが使える。

$ mkvirtualenv myenv

mkdir $PROJECT_HOMEしておけば、プロジェクト(仮想環境と開発用ディレクトリのセット)も作れる。

$ mkproject mypj

参考: virtualenvwrapperコマンドリファレンス

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?