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?

Python venv 仮想環境を使うまで【Windows】(自分用)

Last updated at Posted at 2024-12-25

前提

  • Python & pip インストール済み
  • Windows

事前手順(別環境のPJがある場合)

事前のプロジェクトの依存関係をメモ

pip freeze > requirements.txt

必要なファイルの移管

  • ソースコードとrequirements.txt

手順

プロジェクトのルートフォルダを作る

mkdir Sample
cd Sample

仮想環境(myenv)作成

python -m venv myenv

仮想環境の起動

バックスラッシュ(\)であることに注意。

myenv\Scripts\activate

pip install

pip install XXX
pip install -r requirements.txt

仮想環境の終了

myenv\Scripts\deactivate

参考:pip と venv を使って仮想環境にパッケージをインストールする

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?