why i am getting – file cannot be loaded because running scripts is disabled on this system
Question:
While loading a python file in pycharm i am getting the following warning, earlier it was not there also print('Hello')
is working as expected but i am not able to install django.
File C:UsersabhiPycharmProjectsdjango_appsvenvScriptsactivate.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.
+ CategoryInfo : SecurityError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnauthorizedAccess
Answers:
Try to check this, it may be helpful.
Here’s how you can make it possible to run the PowerShell script:
Open the admin level terminal for Windows PowerShell or the IDE you
are currently using. Enter Get-ExecutionPolicy
. It shows the policy
for the current PowerShell session. You can also enter
Get-ExecutionPolicy -List
to list out the policies for all scopes.
get-execution-policy Change the execution policy for the scope you
want. The command you need for this purpose is: Set-ExecutionPolic
y
-ExecutionPolicy <policy name> -Scope <scope>
. In general, we
recommend using Set-ExecutionPolicy -Scope CurrentUser
-ExecutionPolicy RemoteSigned
, as it is more secure. set-execution-policy If it doesn’t solve the issue, enter:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted
I found two ways that you can tackle this problem succesfully:
-
By enabling PowerShell execution policies:
PS C:Usersusr1>Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted
For example, I encountered this problem when i wanted to run yarn command at my project’s root folder. Then by running the command above, I was abled to run the comand yarn without a problem.

While loading a python file in pycharm i am getting the following warning, earlier it was not there also print('Hello')
is working as expected but i am not able to install django.
File C:UsersabhiPycharmProjectsdjango_appsvenvScriptsactivate.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.
+ CategoryInfo : SecurityError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnauthorizedAccess
Try to check this, it may be helpful.
Here’s how you can make it possible to run the PowerShell script:
Open the admin level terminal for Windows PowerShell or the IDE you
are currently using. EnterGet-ExecutionPolicy
. It shows the policy
for the current PowerShell session. You can also enter
Get-ExecutionPolicy -List
to list out the policies for all scopes.
get-execution-policy Change the execution policy for the scope you
want. The command you need for this purpose is:Set-ExecutionPolic
y
-ExecutionPolicy <policy name> -Scope <scope>
. In general, we
recommend usingSet-ExecutionPolicy -Scope CurrentUser
-ExecutionPolicy RemoteSigned
, as it is more secure. set-execution-policy If it doesn’t solve the issue, enter:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted
I found two ways that you can tackle this problem succesfully:
-
By enabling PowerShell execution policies:
PS C:Usersusr1>Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted
For example, I encountered this problem when i wanted to run yarn command at my project’s root folder. Then by running the command above, I was abled to run the comand yarn without a problem.