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 1 year has passed since last update.

Pythonでvenvを使用して仮想環境を構築するメモ

Last updated at Posted at 2024-05-01

venv(virtualenv)は、プロジェクト毎に独立した仮想環境を作成することができる、Python3の標準ライブラリのこと。
python -m venv <仮想環境名>で作成できる。今回は仮想環境名をvenvとする。

Windowsの場合

  • 仮想環境を作成
python -m venv venv
  • 仮想環境に移動する(アクティベート)
.\venv\Scripts\activate
  • 仮想環境から離れる(ディアクティベート)
 deactivate

Mac, Linuxの場合

  • 仮想環境を作成
python3 -m venv venv

or

python -m venv venv
  • 仮想環境に移動する(アクティベート)
source venv/bin/activate
  • 仮想環境から離れる(ディアクティベート)
 deactivate

参考URL

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?