Screenshot of Visual Studio Code terminal
As shown in the screenshot, python works just fine in Powershell.
I then activate the virtual environment at E:DrewFTCAPIftcapivenv
and python is gone. Not just gone, It doesn’t run anything and produces no output.
I would have at least expected some type of "python" is not the name of any cmdlet, function, etc...
type error, but nothing.
This virtual environment has worked before, on a Debian-based Linux system before I moved the project and virtual environment over to this windows computer.
I decided this was not a duplicate of the numerous other “python virtenv doesn’t work” or “unable to activate virtenv” questions because the lack of output is unique, and because this virtual environment has worked in the past.
I discovered this when translating a BASH script to a Powershell (.ps1
) script, noticing that the python calls (to other scripts) were not being executed.
Get-Command python
produces:
CommandType Name Version Source
----------- ---- ------- ------
Application python 0.0.0.0 E:DrewFTCAPIftcapivenvbinpython
which is the location of the virtual environment.
I’m doing everything in the Visual Studio Code Powershell terminal.
TL;DR Running python
, python3
, and python3.11
(my python version) when the virtual environment is activated does nothing.
Drew Wingfield is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.