LoginSignup
0
1

More than 3 years have passed since last update.

python venv セットアップメモ

Last updated at Posted at 2019-10-15

python venvを自動設定するためのスクリプトを作成したのでメモ

  • 既存のプロジェクトを読み込むときに使用する目的で作成しました。
  • pythonコマンドでpython3が動くことを前提としている

Windows bat

  • venv作成とpip install
cd /d %~dp0

@rem python activate
echo;
python -V
echo;
python -m venv venv
call "venv\Scripts\activate"

@rem dependency
pip install -r requirements.txt

bash

  • venv作成とpip install
#!/usr/bin/env bash

cd $(dirname $0)

# python activate
python -m venv venv
source venv/bin/activate

# dependency
pip install -r requirements.txt
0
1
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
1