Learn Python 3 the Hard Way exercise 0

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.

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.

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.

Try jus typing -py instead of -python

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.

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.

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

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?

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

Best wishes

1 Like

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.

Ohhhh wow I hate PS ISE. I don’t even know why it shows up and also why it just can’t run basic programs.

Anyway, glad you solved it.

Hi I have the same problem as well. Apparently, I don’t have the option to add Python to Path. Can anyone help?

Maybe later during the installation? If you don’t see anything, ask again, it’s possible to add it to your path manually.

Are you installing 2.7 instead of 3.8 on purpose?

This is disturbing but not expected. The Python project cripples the installer all the time for no reason. Where did you download this installer? Can you give me an exact link so I can confirm where you got it and test it myself?

Nope, there really isn’t any option whatsoever when installing. I’m downloading Python 2 as I’m learning from the book “Learn Python the Hard way” and it specifically states not to download Python 3.

I’m not sure if this is the version I’m supposed to download as your book specifically states not to use Python 3.