I’m currently trying to debug what I think is a virtualenv issue with a Python project I’m doing. When I try to run “which python” from PowerShell, I get the following error:
(base) PS C:WINDOWSsystem32> which python
which : The term 'which' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ which python
+ ~~~~~
+ CategoryInfo : ObjectNotFound: (which:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Thanks for your help!
If I try to print the sys.executable from the python interpreter, it seems to work (see below), but the issue is that I want to see if there is a discrepancy between what the different commands output:
(base) PS C:WINDOWSsystem32> python
Python 3.11.3 | packaged by Anaconda, Inc. | (main, Apr 19 2023, 23:46:34) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print(sys.executable)
C:ProgramDataanaconda3python.exe
>>>
New contributor
Safreti is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.