[Tutor] "Python not recognized as a command"

Mats Wichmann mats at wichmann.us
Sat Sep 1 21:11:02 EDT 2018


On 09/01/2018 04:24 PM, Marc Tompkins wrote:
> On Sat, Sep 1, 2018 at 10:40 AM, Dana O'Connor <oconnord at allegheny.edu>
> wrote:
> 
>> Hi,
>> I've been trying to download and use Python 3.7 for the past few days and
>> every time I try to open it it tells me I don't have "pip" which should be
>> impossible because this version of Python is supposed to automatically come
>> with pip (?).  Additionally, whenever I open the command prompt on my
>> computer, the command "python" is not even recognized by the system even
>> though Python is downloaded onto the computer.  I cannot use Python at all
>> until I figure out this problem, so I guess my overall question is why
>> doesn't my computer acknowledge Python when it has been downloaded (and
>> redownloaded) several times on my computer?
>>

So, yeah... if this is Windows (and it nearly always is when someone has
this kind of problem):

windows is a graphical system, and it expects pretty much everything
"normal users" do to be through the gui.  Python follows along and
probably is there and working.  Can you find it by starting to type
python in the search box? the "gui for Python" is called IDLE, and you
can probably find this by starting to type its name into the search box.
 if these resolve to something, python is installed and working.

now, to go the extra step and make it available in the command shell, or
in powershell, or other place where you will type instead of click a
mouse, it needs to be added to the path, as the others have said.  there
was a checkbox for this in the python installer (perhaps in the advanced
section). you may or may not need that.

the installer will have asked you about installing Python Launcher. If
you agreed to this, the command "py" should work from the command shell,
even if "python" did not.  Try it.  the launcher goes in an
always-findable place to try to minimize the kinds of problems you are
finding. but almost no older docs or tutorials talk about it, because
it's a fairly new concept.

if you can bring up the python interpreter by typing "py", you can now
run pip to install packages. quit out of python first (in windows, ^Z
followed by Enter should do it).

ignore the instructions that say to type "pip install something"
directly into the command shell.  instead prefix that with "py -m".

So to install package foo, where your instructions said to type "pip
install foo", instead type "py -m pip install foo".

hope this gets you on the air.



More information about the Tutor mailing list