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.

venvコマンド(Windows, Mac, Linux)

Last updated at Posted at 2023-06-07

venvのコマンド備忘録

1.概要

venvを使う際に毎回調べていた仮想環境の構築、有効化、無効化のコマンドを備忘録にしました。シェルごとにコマンドが微妙に違うのでWindowsのコマンドプロント、Mac(zsh)&Linux(bash)ごとにまとめました。

1.1 venvとは

venvとは、Pythonの標準の言語処理系が持つ機能の一つで、システム上にPythonが動作する仮想的な環境(virtual environment)を作り出すもの。同じシステム上に複数の独立した環境を構成して使い分けることができる。引用:IT用語辞典 e-Words.
venvとは - 意味をわかりやすく

2.Windows コマンドプロンプト

1.構築

py -m venv 仮想環境名

2.構築した仮想環境を有効化

仮想環境名\Scripts\activate.bat

3.無効化

deactivate

3.Mac (zsh) & Linux(bash)

1.構築

python3 -m venv 仮想環境名

2.構築した仮想環境を有効化

. 仮想環境名/bin/activate

3.無効化

deactivate

以上になります。

必要な補足情報や誤植があれば教えていただけると幸いです。

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?