Pycharm Terminal PowerShell – 解決 “.ps1 檔案無法載入

  • Post author:
  • 帖子最後修改:2022 年 8 月 7 日

Windows 11 Pycharm Terminal (.ps1無法載入) pip install(無法使用)

PowerShell 有4種執行原則:

  1. Restricted:所有PowerShell Script(.ps1) 皆無法執行。(Windows系統預設)
  2. AllSigned:所有PowerShell Script都要經過受信任的發行者簽屬過後才可執行。
  3. RemoteSigned:針對從異地下載下來的PowerShell Script需要經過受信任的發行者簽屬過後才可執行,本機的PowerShell Script可直接執行。
  4. Unrestricted:無限制,所有PowerShell Script皆可執行。

win鍵(開始鍵),搜尋Power Shell 以系統管理員身份執行,如下圖

1.輸入 get-executionpolicy

查看目前執行原則。如右圖

2.輸入 set-executionpolicy remotesigned

執行就可以更改了(限量使用RemoteSigned)

選[A] 全部皆是(A)…如右圖

3.確認Pycharm Terminal 正常 pip正常