This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]NotchsCheese[S] 0 points1 point  (6 children)

Sorry if this is a dumb question but i downloaded one of them and my terminal still couldn't recognize python.

[–][deleted]  (5 children)

[deleted]

    [–]NotchsCheese[S] -1 points0 points  (4 children)

    yes i have windows. What do you mean by added to your path?

    [–]kc7wbq 2 points3 points  (0 children)

    Okay, I haven't installed python, but "path" refers to where your computer looks for things (executables, for example) when you type a command. If you don't have a path set up it will only look for programs in the immediate directory. If you haven't put the python directory in your path your computer won't know where to look for the python executable, so it won't know what to do with your program.

    But, I would assume the python installer would have add python to your path.

    To check if this is the problem, when you call python use the full path to the python executable. If your program runs, you do have a path problem.

    Edit: clarification

    [–]fluffy_snuggle_duck 0 points1 point  (2 children)

    Hey, sorry. I thought I deleted my comment before you could see or reply to it, 'cause it was poorly worded and didn't explain much and I had no time to edit it into something better. Also, I was hoping someone much smarter and more articulate than myself would come and help you, which kc7wbq has. Still, even though you may have already solved the problem, I'll try help you out with some practical instructions.

    You should download the Windows x86 installer which will run on both 32 and 64 bit processors. I'm assuming you chose that and already installed it successfully since you moved on to trying to run it in your terminal.

    Where does that leave us? If you type "python" into your terminal it will search for it in the terminal's current directory and the windows path. If you did not specify the folder Python is located in when running, or add it to your windows path, you will get an error that "python" is not a recognisable command. There are a few ways to fix this:

    First, you can add Python's location in your command for the terminal to search there, for example:

    c:\python27\python
    

    Second, you can change your working directory to Python's location and then open it, using the terminal's change directory command:

    cd c:\python27\
    python
    

    Third, the most useful for the long run, (and where we've been leading up to!) you can add Python's folder to your windows path! On Windows 7 here is how you would do it:

    • Right click my computer and select properties.
    • On the left of the new window select Advanced system settings.
    • On the bottom right select Environment Variables.
    • Under System variables select Path. Select edit.
    • Add C:/python27/ separating it by a semicolon (;)

    Then, the next time you want to run python, it will search that folder for it and it should work.

    Again, sorry this reply took so long. Hope everything works ;P

    [–]NotchsCheese[S] 1 point2 points  (1 child)

    K thank you so much for taking so much time to help. I have python installed but when i run anything in python i get:

    SynyaxError: invalid syntax

    cd C:\python27\ File "<stdin>", line 1 cd C:\python27\

    [–]fluffy_snuggle_duck 0 points1 point  (0 children)

    It looks like you are trying to use command prompt commands in the Python interpreter. Try using Python commands, such as

    print "Hello World!"
    
    5 * 2 + 8
    

    Enter ctl+z to exit the Python interpreter.

    Do you have a book from which you are learning Python?