Skip to content

Activating an environment fails because running powershell scripts is disabled by default on Windows #2559

Description

@qubitron

Environment data

  • VS Code version: 1.27.1 (user setup)
  • Extension version (available under the Extensions sidebar): 2018.8.0
  • OS and version: Windows 10
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.7..0
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv
  • Relevant/affected Python packages and their versions: N/A

Actual behavior

Creating a new terminal in a fresh Windows install results in a powershell error

PS C:\dev\loadtest> & c:/dev/loadtest/env/Scripts/activate.ps1
& : File C:\dev\loadtest\env\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:3
+ & c:/dev/loadtest/env/Scripts/activate.ps1
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

Expected behavior

I don't need need to disable running scripts in able to use VS code

Steps to reproduce:

  1. Fresh install of windows
  2. install python
  3. create virtual environment
  4. try to activate it in VS Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-environmentsFeatures relating to handling interpreter environmentsarea-terminalfeature-requestRequest for new features or functionalityverification-neededVerification of issue is requestedverifiedVerification succeeded

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions