indrajith_19
indrajith_19

Reputation: 1

Virtual Environment setup issue in Powershell

In vs code when I am trying to setup virtual environmentin powershell, it shows this message.

.venv\Scripts\activate : File C:\PYTHON\.venv\Scripts\Activate.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at 
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ .venv\Scripts\activate
+ ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

I used this command to activate the virtual env

.venv\Scripts\activate

Then I found a solution online for this, It said to use the command

Set-ExecutionPolicy RemoteSigned -Scope Process

It worked, but I am forced to use this command every time when I try to activate Virtual Environment. Its like when I close the terminal and open a new one, I have to run this command.

The virtual environment is working fine on cmd, the issue is only for powershell.

PS: I tried to set the command from the windows powershell and the vscode. Also I am new to python and vscode.

Expecting to activate a virtual env in the powershell.

Upvotes: 0

Views: 31

Answers (0)

Related Questions