【python】venvを用いたgit管理について

開発環境

  • WSL2 (Windows10でも可能)
  • python 3.8

手順

プロジェクト作成

$ python -m venv ~/path_to_your_project_folder
$ cd ${YOUR_PROJECT_FOLDER}
$ git init
$ touch .gitignore
/bin
/include
/lib
/lib64
/share
pyvenv.cfg

レポジトリからの環境構築

$ git clone https://from_your_repository_url
$ cd ${YOUR_PROJECT_FOLDER}
$ python -m venv .


# WSL2
$ source bin/activate
# Windows PowerShell
$ Scripts\Activate.ps1

$ pip install -r requirement.txt

# 環境終了 (仮想環境内にて)
$ deactivate