報(bào)錯(cuò)信息:
無(wú)法加載文件D:\WWW\apython\demo\venv\Scripts\activate.ps1,因?yàn)樵诖讼到y(tǒng)上禁止運(yùn)行腳本。有關(guān)詳細(xì)信息,請(qǐng)參閱https:/go.microsoft.com/fwlink/?LinkID=135170中的 ab out_Execution_Policies。? ? +CategoryInfo:SecurityError: (:) [],ParentContainsErrorRecordException+FullyQualifiedErrorId:UnauthorizedAccess
原因:
Restricted(防止運(yùn)行沒(méi)有數(shù)字簽名的腳本),要設(shè)置成remotesigned模式
解決方法:

Windows PowerShell
版權(quán)所有 (C) Microsoft Corporation。保留所有權(quán)利。
嘗試新的跨平臺(tái) PowerShell https://aka.ms/pscore6
PS C:\Windows\system32> get-ExecutionPolicy
Restricted
PS C:\Windows\system32> set-ExecutionPolicy?
RemoteSigned
執(zhí)行策略更改
執(zhí)行策略可幫助你防止執(zhí)行不信任的腳本。更改執(zhí)行策略可能會(huì)產(chǎn)生安全風(fēng)險(xiǎn),如 https:/go.microsoft.com/fwlink/?LinkID=135170中的 about_Execution_Policies 幫助主題所述。是否要更改執(zhí)行策略?
[Y] 是(Y)? [A] 全是(A)? [N] 否(N)? [L] 全否(L)? [S] 暫停(S)? [?] 幫助 (默認(rèn)值為“N”): Y
PS C:\Windows\system32> get-ExecutionPolicy
RemoteSigned
PS C:\Windows\system32>