LoginSignup
3
7

More than 3 years have passed since last update.

windows環境にてpythonのバージョンを指定してvenvを作成する

Posted at

課題

開発端末に複数のpythonがインストールされている場合に
venvで仮想環境を作成するとPATHが通っているバージョンで仮想環境が作成される。
PATHの値を変更せずに異なるバージョンでのvenvの作成方法をここにまとめる。

venvの作成方法

バージョンを指定せずに(PATHが通ったpythonのバージョンで)venvを作成する

python -m venv test

バージョンを指定してvenvを作成する

py -3.7 -m venv test

-x.xの部分にインストールされているpythonのメインバージョンを指定する。

参考記事

Python、venvで仮想環境を作る

3
7
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
3
7