Learn Python 3 the Hard Way exercise 0


#1

Hello everyone, this is my first post in this forum. I’m trying to follow the instruction of exercise 0 but when I typed python on windows powershell I got this response below:

python : The term ‘python’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

At line:1 char:1
+ python
+ ~~~~~~
    + CategoryInfo          : ObjectNotFound: (python:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

I have no idea how to fix it and really need help because I can’t start the later exercises if I can’t get pass this one. Thanks for the help.


#2

I believe I got this error when I installed Python the first time and didn’t click the little check box to add to Path.

I reinstalled it again and checked the little box. You can google how to add it using the Environment Variables if you like but I get antsy messing with system paths.


#3

I did click the little check box about adding path, but it didn’t show on windows powershell. It worked when I tried on cmd though. Maybe I will have to try your suggestion, but I’m kinda worry that I might bust my computer.


#4

Try jus typing -py instead of -python


#5

If you’re getting this then you must not have actually checked the box to add python to the path, OR you did but then didn’t restart powershell so that it’s enabled. Some things to try:

  1. Just install python again and make triple positive sure you actually clicked that check box.
  2. Restart your machine.
  3. See if it’s there now, and try python3.6 instead of python (try both).
  4. If it still doesn’t show up, do you have some special administration system that is preventing you from doing this? If you work at a company many times they prevent you from changing the path. Contact your admins if that’s the case.

You’ll also have to tell use what version of Windows you’re on. Finally, if all that fails then I guess try out Cygwin or Windows Subsystem for Linux and just do it linux style.

Keep in mind that I do the entire book on Windows with PowerShell, so if it’s not working then there’s something different about your machine.


#6

I finally did it. Instead of normal installation, I went to custom install and ticked all the box, including adding python to path. Either that or restarting the computer several times get it to work, but the point is that it is showing when I type on powershell.


#7

Yep, that sounds like windows. Not sure why they have such a problem with the path.


#8

Hi,
In line with this issue I’d also like to report mine (see screenshot). I need to point out that I did the box to add python to path. What’s wrong? How can I get over it?


#9

Sorru, problem solved. I was using PS ISE until I saw the video.
Sorry for bothering…

Best wishes
Julia


#10

Ah, you are running PowerShell ISE and, for whatever reason, that doesn’t work at all. Run the regular PowerShell.

Now, once you run regular powershell most likely you forgot to hit the little checkbox in the Python installer that says “Add python to the PATH.” Rerun the installer, click that checkbox (first or 2nd screen), and then reboot your computer just to be sure.