Hack Forums
[Python] My computer won't run python even after installation - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Python] My computer won't run python even after installation (/showthread.php?tid=5719057)



My computer won't run python even after installation - fogstone - Sep 16, 2017

After I installed Python 2.7 on Windows 10, I got this error:

Code
PS C:\Users\William Smith\Desktop\New CIT 270\Python> python
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

PS C:\Users\William Smith\Desktop\New CIT 270\Python>

I then looked up how to install Python and got this:

https://www.youtube.com/watch?v=zNHqcy6ZguQ

When I followed it I got the same error. So I went to stack overflow and someone had asked a similar question:

https://stackoverflow.com/questions/13596505/python-not-working-in-command-prompt

But when I tried the solution that worked for him I got the same error.

What gives? That is so stupid. WTF?! I NEED PYTHON BWARGH!!!

I know Python comes preinstalled on Ubuntu and any Linux (at least Debian based ones). So I know I can do it on my Ubuntu computer as a backup but could someone please help me with this on Windows 10 anyways? Thanks.


* - Nachfolger - Sep 16, 2017

I'm a noob when it comes to python, but I thought python had it's own CMD that installs when you install Python? Create a simple Python file, name it .py, and try and running it.


* - Fizure - Sep 16, 2017

(Sep 16, 2017 03:21 PM)Nachfolger Wrote:  I'm a noob when it comes to python, but I thought python had it's own CMD that installs when you install Python? Create a simple Python file, name it .py, and try and running it.

You can also run it through cmd by typing "py" without the quotation marks (not python in cmd like op did though). It also has an IDE which installs with it though. Either way op why are you installing 2.7? Why not 3? 2.7 is outdated now lol.


* - #YOLO - Sep 16, 2017

Did you add python to your PATH?


* - Molino. - Sep 16, 2017

Did you add the Python install path to PATH in the Environment Variables? I remember I had to do this when I installed python. I'll drop a link in a second.


* - fogstone - Sep 16, 2017

Nevermind. I made it run myself by reinstalling for only one user. I think it was a permissions thing.


* - datguy.dev - Sep 16, 2017

When you type ipconfig in the prompt it knows where that executable is given the system path environment variable. You need to manually add the path of python.exe to your environment variable. Everyone must do this.

See: "Setting environment variables" or find a tutorial to explain it.
https://docs.python.org/2/using/windows.html
http://www.aaronstannard.com/how-to-setup-a-proper-python-environment-on-windows/

Use explorer, the file manager, and go to where python.exe is. Hold shift and rightclick and open area of the window. Select open CMD prompt here. then type python.exe.


* - fogstone - Sep 16, 2017

(Sep 16, 2017 03:30 PM)datguy.dev Wrote:  When you type ipconfig in the prompt it knows where that executable is given the system path environment variable. You need to manually add the path of python.exe to your environment variable. Everyone must do this.

See: "Setting environment variables" or find a tutorial to explain it.
https://docs.python.org/2/using/windows.html
http://www.aaronstannard.com/how-to-setup-a-proper-python-environment-on-windows/

Use explorer, the file manager, and go to where python.exe is. Hold shift and rightclick and open area of the window. Select open CMD prompt here. then type python.exe.

Yeah I already did that and it worked before you said it. But thanks.


* - arkoydas - Sep 16, 2017

I am using windows 10 and it is working fine for me.
If you have installed python and you just cannot use it with the terminal you should do the following.

Go and right click the windows icon and select file explorer,then right click in This PC and click properties.

Then click Advanced system settings and Enviroment variables.

Now you have to add python to your path environment variable.
Add python's path(that is where python is located) to the end of the list (the paths are separated by semicolons). For example:
Quote:C:\Windows;C:\Windows\System32;C:\Python27


And some extra information about path env var.
[Image: bS-F7WgrQoWW-GzQsfZIlA.png]


* - fogstone - Sep 16, 2017

(Sep 16, 2017 06:54 PM)arkoydas Wrote:  I am using windows 10 and it is working fine for me.
If you have installed python and you just cannot use it with the terminal you should do the following.

Go and right click the windows icon and select file explorer,then right click in This PC and click properties.

Then click Advanced system settings and Enviroment variables.

Now you have to add python to your path environment variable.
Add python's path(that is where python is located) to the end of the list (the paths are separated by semicolons). For example:
And some extra information about path env var.
[Image: bS-F7WgrQoWW-GzQsfZIlA.png]

That's helpful info. It now works with the terminal because I made it but I will definitely read this. It def looks like useful info.


* - Hash G. - Sep 16, 2017

While you're at it, uninstall py2 and use py3. There is no reason why you would prefer Python2 over Python3 tbh.


* - Saitama - Sep 17, 2017

Add the python directory path that contains the python exe in your path that is present in enviroment variables (look up for more info).
Then it would be accessible via cmd.