0

Update 3: Found it - it's a "helpful" feature of Windows to go find apps via the Windows store (details here).

I installed Anaconda (following a Udacity course) and am trying to get it set up right to run on Windows. The Udacity course assumes I have Git Bash (I don't) and so it's not much help.

I added the following to the path:

  • C:\Users\david\anaconda3
  • C:\Users\david\anaconda3\Scripts

When I run "conda --version" I get the expected version number. But when I run "python --version" I get:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional>python --version
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.

C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional>

When I run "path", it is there:

... 
Studio\bin;C:\Users\david\.dotnet\tools;C:\Users\david\AppData\Local\GitHubDesktop\bin;C:\Users\david\anaconda3;C:\Users\david\anaconda3\Scripts;C:\Program Files\JetBrains\PyCharm 2021.1.2\bin;;;C:\Program Files (x86)\Microsoft Visual St
...

And explicitly setting the location of python.exe works:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional>\users\david\anaconda3\python --version
Python 3.8.8

C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional>

So why does it not find it when I just run python?

Update: Yes I opened a new command window after saving the additions to the path (always a good question to ask though).

For running where:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional>where python
C:\Users\david\AppData\Local\Microsoft\WindowsApps\python.exe
C:\Users\david\anaconda3\python.exe

C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional>

So it finds it under where, but not when trying to run it.

Update 2: Is it possible that Windows does not want to run apps under the c:\users folder for security reasons? It's an unusualy place to put a .exe.

5
  • Try running where python and see if that's in your path too. Commented Jun 16, 2021 at 15:59
  • Did you open a new cmd after adding python to path ? Commented Jun 16, 2021 at 15:59
  • @not_speshal where finds it (added result above), but it doesn't find "python". Commented Jun 16, 2021 at 16:04
  • @not_speshal I just searched in the add/removes applications. The only hit for python is anaconda. And I don't recall earlier installing python. Could it just be part of Windows? Commented Jun 16, 2021 at 16:13
  • I doubt it - I had a local installation of Python that was interfering with Anaconda too. Probably not recommended, but I just deleted that folder. If you choose to do this, please make sure you have a backup in case it breaks something else. Commented Jun 16, 2021 at 16:16

1 Answer 1

2

This is mostly a guess since you haven't provided the full value of your PATH variable, but I think the entry for your Anaconda folder occurs after the entry for <user>\AppData\Local\Microsoft\WindowsApps\python.exe so it gets hidden.

Windows searches the folders in PATH in order and executes the first python.exe file that it finds, which in this case is the message saying to download Python from the Store.

Try making \users\david\anaconda3\ as the first value in your PATH value.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.