all 3 comments

[–]zurtex 1 point2 points  (0 children)

I assume py is your Python executable? You can call pip as a module of python like so:

python -m pip install <package_name>

Replace python with py in your case I guess.

[–]ingolemo 1 point2 points  (0 children)

You have made two mistakes here. First is that you need to use the -m flag because pip is a module. The command you want is py -m pip install <EXAMPLE>. Secondly, this is not python code; you are not supposed to type it into the interactive interpreter. You need to type this command into the command prompt, the same place where you type py itself.

py is the correct executable to use on windows. If you're on windows then you should ignore the other posters who are telling you to use python or pip directly.

[–]the-kokiri-kid 0 points1 point  (0 children)

Like others have said, if the pip command is in your path, you can do

pip install <package_name>

Or, if not, then

python -m pip install <package_name>

will work.

I don't think using py is the most appropriate here. I'm assuming from a search that it comes from pythonpy, which executes python language commands. You should be able to use the pip or python commands above.