LunaDEV-net / WebKess

0 stars 0 forks source link

PSSecurityException, UnauthorizedAccess while trying to access to venv on Winows #1

Open LunaDEV-net opened 2 hours ago

LunaDEV-net commented 2 hours ago

Problem

While attemting to access the venv in PowerShell, and UnauthorizedAccess Error is thrown.

PS D:\.code\python\WebKess> .\.venv\Scripts\Activate.ps1
.\.venv\Scripts\Activate.ps1 : Die Datei "D:\.code\python\WebKess\.venv\Scripts\Activate.ps1" kann nicht geladen werden, da die
Ausführung von Skripts auf diesem System deaktiviert ist. Weitere Informationen finden Sie unter "about_Execution_Policies"
(https:/go.microsoft.com/fwlink/?LinkID=135170).
In Zeile:1 Zeichen:1
+ .\.venv\Scripts\Activate.ps1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : Sicherheitsfehler: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

Metadata

> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.19041.4894
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.4894
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
> [Environment]::OSVersion.Version

Major  Minor  Build  Revision
-----  -----  -----  --------
10     0      19045  0
LunaDEV-net commented 2 hours ago

Fix

Follow Link: https:/go.microsoft.com/fwlink/?LinkID=135170 mirror I would recomand RemoteSigned since it allows it with a warning

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

(needs Admin Rights)