0

I tried the answer to when this was asked previously and it didn't work, so I'm asking here.

I'm very new to both windows and python, and am trying to run python from my (Windows 10) command line so that I can use pip to install a package (SpaCy). I'm not entirely sure what I'm doing wrong, but after the

C:Users\myname>

typing

C:Users\myname>python

leads to an invalid syntax error, saying:

'python' is not recognized as an internal or external command, operable program or batch file.

I have python 2.7 installed on my computer, and it works when I use an interpreter such as Rodeo.

I also get the same error when trying to use pip to install SpaCy, although when I try to install pip I get a message that pip is already installed.

Is there some basic knowledge I'm just missing?

asked May 18, 2018 at 20:23
2
  • I think on windows all runnable binaries end in .exe, so try to run python.exe. Commented May 18, 2018 at 20:26
  • You need to either qualify the path to the exe you are using - or put the path to python.exe into the windows %path% variable so it looks for it there. You can google solutions to this with ease. - you can even watch it on the youtubs: youtube.com/watch?v=Y2q_b4ugPWk Commented May 18, 2018 at 20:28

4 Answers 4

1

When you installed Python, there would have been a tick box that wanted to know if you would like the Python Path adding to the Environment variables. As you didn't select this, your Windows Path doesn't include the folder where the Python executable lives.

To fix this, rerun the installer and modify your install, it should pop up the screen with the tick boxes on, select the one mentioned above and the job should be done.

This is how it works with the Python3 installer, anyhow and I assume that 2.7 will use the same basic model.

answered May 18, 2018 at 20:28
Sign up to request clarification or add additional context in comments.

1 Comment

Or you could manually edit the Path variable as some of the other answers have suggested. It depends on your level of confidence.
0

You may need to add the newly installed location of python to your path variable.

Control Panel> System> Advanced system settings> Environment variables

Find "Path" and edit. Append a semicolon ';' and add the full path to your python install location.

To try your new path, you may need to start up another command line cmd.exe to pick up the new PATH.

Comments

0

You need to add python.exe to your Path:

Locate where Python is installed. It's usually located at:

C:\Users\<username>\AppData\Local\Programs\Python\<version>

Now you need to add this directory to your path. To do that press Windows Key, search for 'Environment Variables' and click on 'Edit the System Environment Variables'.

Then 'Environment Variables...'

Click on 'Path' variable and hit 'Edit...'

Then, 'New'...

Put the directory where your Python.exe is installed and hit okay,

Restart your command prompt and try again.

answered May 18, 2018 at 20:29

Comments

0

You need to add python installation path to your environment variable.

Click search icon on windows task bar--> type "environment variable" Edit environment variable will pop (System or User)--> add path to python installation till bin to "Path" variable.

answered May 18, 2018 at 20:31

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.