简体   繁体   中英

How to find location of an executable?

I seem to have a "rogue" copy of python.exe on my Windows 11 machine. When I use it to create a virtual environment with the command "python -m venv venv", it produces an environment in which pip always fails. I have uninstalled Python from the add/remove probrams menu but will when I open a command prompt or a power shell and give the command Python, it responds cheerfully with Python 3.10.5 (main) [GCC 12.1..."

I can't use pip in any virtual environment

How can I determine where it is finding Python? How can I override it with a good Python?

In the Windows Powershell you can use the Get-Command command to find where a specific executable is being ran from. In CMD you can use where .

If you want to use a Python runtime that you have recently installed, and you know where it is located, I would just add that location to my PATH towards the top of the list so that when you run python in your terminal, you get that python.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM