Hey all!
I’m just getting started with Python and trying to run scripts from the command line, but I keep running into this error:
'python' is not recognized as an internal or external command
I installed Python from the official website (on Windows), but it seems like something’s missing. Do I need to add Python to PATH manually?
If someone could walk me through what PATH is and how to add Python to it (especially on Windows), that would be amazing.
Thanks in advance!
The error you’re getting is extremely common for beginners. It usually means Python was installed, but the system doesn’t know where to find it when you type python
in the terminal.
The fix? You need to add Python to PATH.
Let’s break it all down: what PATH is, how to add Python to it on Windows/macOS/Linux, and how this ties in with tools like Cloudinary if you’re using Python for image uploads or automation.
PATH
is an environment variable, basically a list of folders your system searches when you run a command in the terminal.
When you type python
in your terminal, your system looks through each directory in the PATH list and tries to find an executable named python
. If Python isn’t in one of those folders, you’ll get
'python' is not recognized...
When installing Python from python.org, you’ll see this checkbox at the bottom of the setup screen:
☑ Add Python to PATH
Always check this. It’s the easiest way to avoid issues.
If you’ve already installed Python and didn’t check the box, use Option 2 below.
- Find your python installation directory. Example paths:
C:\Users\YourName\AppData\Local\Programs\Python\Python311
C:\Python39\
- Copy these two paths:
- The main folder (e.g.,
C:\Python311\
) - The Scripts folder (e.g.,
C:\Python311\Scripts\
)
- The main folder (e.g.,
- Update environment variables.
- Open Start → Search for Environment Variables.
- Click Edit the system environment variables.
- Click Environment Variables.
- Under System variables, find Path, then click Edit.
- Click New and paste each path.
- Apply and restart terminal.
- Open a new command prompt and type
python --version
. If everything worked, you’ll see the installed Python version.
- Open a new command prompt and type
On most Unix-based systems, Python is already installed, but it may be under python3
.
To check, try the terminal command which python3
. To make python
run Python 3, add an alias in your shell config:
alias python=python3
# Then run:
source ~/.bashrc
# or:
source ~/.zshrc
Code language: PHP (php)
You can also use:
export PATH="/usr/local/bin/python3:$PATH"
If you installed Python via brew, you can link it like so:
brew install python
brew link python
Run the following in your terminal:
python --version
pip --version
Both should return versions, not errors. You’re good to go!
Check:
- Did you restart your terminal?
- Is your Python version conflicting with an older version?
- Are you using PowerShell, Git Bash, or WSL?
Sometimes using a tool like Anaconda or uv can help manage environments more cleanly.
Step | Details |
On Windows | Reinstall Python with “Add to PATH” checked, or edit env vars manually |
On macOS/Linux | Use alias or export PATH in shell config |
Test it | Run python --version in terminal |
Use in projects | Cloudinary scripts and CLI tools need it on PATH |
Knowing how to add Python to PATH is one of those behind-the-scenes skills that makes your dev life smoother, especially when installing it on new machines or dev environments based on Windows.
And if you’re using Cloudinary to handle images in your app, having Python correctly configured lets you tap into the full power of our SDKs for uploading, transforming, and delivering media on the fly.
Need help setting up Cloudinary’s Python SDK or automating media uploads from the command line? We’ve got docs and code samples to help.