1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

仮想環境の作成とactivate

Last updated at Posted at 2022-08-29

仮想環境の作成とactivateの流れ(Linux, Mac, Windows)

Linux, Mac

Linux, Mac
$ cd Desktop
$ mkdir dir名
$ cd dir名
$ python3 -m venv 仮想環境名 # 仮想環境作成
$ source 仮想環境名/bin/activate # activate

Windows

共通部分
C:\> cd Desktop
C:\> mkdir dir名
C:\> cd dir名
cmd.exe
C:\> python -m venv 仮想環境名
C:\> 仮想環境名\Scripts\activate.bat
powershell
C:\> python -m venv 仮想環境名
C:\> 仮想環境名\Scripts\Activate.ps1
  • 上記コマンドが実行できない場合以下を入力
    • 2行目は、念のため
C:\>Set-ExecutionPolicy RemoteSigned -Scope Process
C:\>python -m pip install --upgrade pip ←pip がインストールされていない場合

deactivate

$ deactivate # 仮想環境の終了
1
2
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
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?