DEV Community

PyLenin
PyLenin

Posted on

4

What if you forget to add Python to the PATH variable?

If you forget to add Python to the PATH, you won't be able to run Python in your command line from any other directory.

You will get a message saying,

'python' is not recognized as an internal or external command.

This is because Windows is trying to search for Python in its PATH variable and is unable to find it.

Here is a step-by-step instruction to add Python to the PATH variable in Windows 10.

  1. Copy the directory to which Python is being installed.
  2. Search for System Properties in the Search Bar.
  3. Click on the "Environment Variables" button in System Properties.
  4. Click on the "Path" variable and then click on "Edit".
  5. Now here's the deal. Pay Attention! Paste the directory path from Step 1 at the top of the list. You can use the "Move up" button to get it to the top. Now click on "Ok".

Now you can open up your command line and run python. The Python interactive shell will open up.

*Here is a little extra tip! *

Add the Scripts folder to the PATH variable too. This is the folder where all your libraries will be installed.

If the instructions are not clear enough for you, you can also check out the visual guide containing images of every step, on my blog for achieving the above objective.

Good luck and let me know!

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay