1
4

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 3 years have passed since last update.

Python3 venvによる環境構築

Last updated at Posted at 2020-06-07

venvによる環境構築メモ

環境を作成

python3 -m venv ./path/to/env

Activate(環境を有効化)

source ./path/to/env/bin/activate

pipのバージョンアップ

pip install --upgrade pip

Deactivate(環境を無効化)

deactivate

インストールされているパッケージを確認(pip)

pip freeze

環境を削除

python -m venv --clear ./path/to/env

環境を複製

  1. 複製元のライブラリをファイル出力
  2. 新しい環境で1で出力したファイルに記載されたライブラリをインストール

1. 複製元の環境のライブラリを出力

pip freeze > requirements.txt

2. 新しい環境でライブラリをインストール

pip install -r requirements.txt
1
4
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
1
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?