Created
December 14, 2025 12:54
-
-
Save kouichi-c-nakamura/975ff30de488bcc623e4e1b0de279bff to your computer and use it in GitHub Desktop.
Python virtualenv set up
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ---------------------------------------------------- | |
| # Python 仮想環境 (Virtual Environment) セットアップ手順 | |
| # ---------------------------------------------------- | |
| # 1. virtualenv が未インストールの場合はインストール | |
| # (多くの場合、Pythonに標準搭載されている venv モジュールで代替可能ですが、 | |
| # 互換性のために必要な場合は実行してください) | |
| # pip install virtualenv | |
| # 2. 新しい仮想環境を作成 (フォルダ名は 'venv') | |
| virtualenv venv | |
| # 3. 仮想環境に入る (macOS/Linux) | |
| # Windowsの場合は: .\venv\Scripts\activate | |
| source venv/bin/activate | |
| # 4. 仮想環境から抜けるときは 'deactivate' | |
| # deactivate | |
| # 5. 現在の環境の依存関係を requirements.txt に保存 | |
| pip freeze > requirements.txt | |
| # 6. requirements.txt に基づいて依存関係をインストール | |
| pip install -r requirements.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment