0
0

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 5 years have passed since last update.

PowerShellでのvitualenvを用いた仮想環境のアクティベート方法

Last updated at Posted at 2019-12-21

環境

  • PowerShell 5.1.17763.771
  • virtualenv 16.7.9

仮想環境のアクティベート

. .\<env>\Scripts\activate

これだけだとうまくいかないことがある。
なぜならWindowsの実行ポリシーの関係でスクリプトが実行できないから。
なので、実行ポリシーを変更する。

実行ポリシーの変更

実行ポリシーについてはスコープとポリシーについて詳しく記載してあるものが、下記のサイトにあるので参考に。
https://docs.microsoft.com/ja-jp/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-6

今回は仮想環境をアクティベートするためのコードのみ記す。

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

これで再度、仮想環境のアクティベートのコードを実行すればうまくいく。

以上。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?