Skip to content
Advertisement

Tag: powershell

Detect whether current shell is powershell in python

What’s the recommended way to check which shell is my python program running inside? I know I can query os.environ.get(‘SHELL’) for the shell name, but what can I use to determine powershell? Answer Generally, environment variable SHELL does not tell you what shell invoked your script, it only tells you the binary path of the current user’s default shell (on

virtualenv activate does not work

I am trying to create a virtual environment to test an api. I can create the environment just fine using virtualenv test, then I can cd into it. When I try to run activate, I get this error: I recently updated windows, and it replaced the cmd with Windows Powershell. My virtualenv worked fine with the cmd, so I suspect

virtualenv in PowerShell?

There seems to be a problem when virtualenv is used in PowerShell. When I try to activate my environment in PowerShell like… .. nothing happens. (the shell prompt should have changed as well as the PATH env. variable .) I guess the problem is that PowerShell spawns a new cmd. process just for running the activate.bat thus rendering the changes

Advertisement