Just documenting a quick note for me to refer back later.
Problem
When I was trying to check the AWS CLI version on my terminal, I get this warning in return:
which made me go: "Hang on, pretty sure I have anaconda installed".
It must be because when I was installing anaconda, I didn't pick the setting so that Python is added to the environment.
How to Fix It
Method 1: Run Command Prompt as Administrator:
Type the following commands, substituting the path to your Anaconda Python:
assoc .py=Python.File
ftype Python.File="C:\Users\YourName\anaconda3\python.exe" "%1" %*
These commands tell Windows to associate .py with a “Python.File” type, and then map “Python.File” to your Anaconda Python executable.
Method 2: Use the Windows Default Apps Settings (No Admin Required):
- Open Settings → Apps → Default apps.
- Click Choose default apps by file type and scroll to .py.
- Select the current default app (or “No default”) and browse to your Python interpreter (e.g. C:\Users\YourName\anaconda3\python.exe).
Now it's gone.
Top comments (0)