Skip to main content

[SOLVED] Issues with Python Path after installation

After installing python on freshly installed windows 10. I could not call the python command from the command line interface.

TL;DR: After a bit of trial and error. I figured; I had to make the python path the first entry in the list of path variables.

before: PATH=C:\Program Files (x86)\Intel\iCLS Client\;...C:\Users\Admin\AppData\Local\Programs\Python\Python37...;

After: PATH=C:\Users\Admin\AppData\Local\Programs\Python\Python37;C:\Program Files (x86)\Intel\iCLS Client\;...


The Python path story

I got a brand new windows 10 installation recently. I decided I was going to use this workstation to prepare for my python interviews.

So after a few clicks, I installed python3.7 from a local copy on my flash drive.

After installation, I expected that the environment variables will be set but it wasn't. I updated the path variables manually.

To my surprise, Python was still not recognized. Let me show you what my Path variables looked like.

image 1.1 Environment Paths

To resolve this issue, simply click the python path to highlight it, then click on the "Move Up" button. Move python up so it becomes the topmost item on the list.

Then open a new CMD and see your python command working.

The issue has been resolved. If you are still having issues, please visit this StackOverflow discussion for further assistance.


WHY DID THIS WORK? Read on

By default, some windows installations have a default expectation that Python's install directory is what we have highlighted below.


If Windows is unable to find Python in this directory, we are simply redirected to the Windows App store to download the latest python.

If you check our previous image, you will observe that this "App store" path comes before our Python path Hence it takes precedence when there is a conflict.

If we move our Python path to come before the "App store" path, then our python path will have higher precedence too. and this is what we have done. See image below:

C'est Fini.

It will be great to hear your experience on similar things, please drop a comment. Thanks.



Comments

Popular Articles

Laragon: installing more versions of Apache/HTTPD

Most of the time, we casually install various PHP versions and server tools without checking if they were built for Win32 or Win64. A discussion for another day. I recently downgraded Laragon’s from PHP8.1-x64 to PHP7.x-x86. This had a little consequence - APACHE! Hence, I got the error below, indicating that my PHP and Apache can’t work together because they are of different architectures or builds.   The originally installed Apache was for 64-bit PHP versions, there are no Apache versions designed to run both 32-bit and 64-bit builds of PHP. In this article, I share steps and links that guide you to install multiple versions and builds of Apache on Laragon. 1. For all intent and purposes, you are advised to always download the latest version of Apache. Visit this URL https://www.apachelounge.com/download/additional/ to see the different versions available. It is easy to access the 64-bit versions from the homepage. However, to access the 32-bit versions, you need to use this URL. 2

Resolving Incompatible Builds of PHP and Apache in Laragon: Add multiple versions of Apache

 As developers, it's often the case that different versions of PHP and server tools are installed quickly without taking into account the architecture for which they were built. In this article, we will focus on solving a specific error that arises when running incompatible builds of PHP and Apache. Recently, I encountered an issue when downgrading my Laragon setup from PHP 8.1 (x64) to PHP 7.x (x86). This caused compatibility problems with Apache, and I received an error message indicating that my PHP and Apache builds were not compatible, as the Apache installed was built for x64 versions of PHP. In this article, I'll provide a step-by-step guide on how to install multiple versions of Apache on Laragon. By following these steps, you can resolve any similar issues that you may encounter. Step 1: Download the Latest Version of Apache Visit https://www.apachelounge.com/download/additional/ to download the latest version of Apache. The homepage provides quick access to 64-bit ve

VS CODE: Unable to install extensions on Ubuntu/Linux

Hey, its one of those days, i just wished i could code away the night. i decided that tonight, it was going to be VS Code all through. I closed Sublime text. It was not long before I started missing the php code linting and ever intelligent code completions that were built into sublime text. I checked the suggestions on the Extensions Tab of VS Code. and there it was! Felix Becker's "PHP IntelliSense" package. To my cute surprise, Upon clicking, the extension's description and Installation "Read Me" could not display correctly, 'twas as good as blank. All i could see was this: I thought, this is something light, so i started searching but then it was not better explained except for the GitHub issue which I found to be useful, Link is at the bottom of this page.  I hate to discover it was a DNS issue. How to detect the Issue Simply visit the URL below, if you are able to view the image on the page, then you are not affected by this issue. DNS Test URL: ht