Never thought I'd need to ask this question as a CCNA and Network+ holder, I guess Python has decided to make the simple act of a pip install THIS difficult, wow! I have Python installed as well as Virtual Studio Code. I try this from command prompt
pip3 install requests File "<stdin>", line 1 pip3 install requests ^^^^^^^
And that's all I get, again and again and again. So I try this in the Visual Studio terminal:
pip3 : The term 'pip3' 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
-
pip3 install requests
-
+ CategoryInfo : ObjectNotFound: (pip3:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
Mind blowing stuff here. I JUST want to be able to pip install. I've also tried just using "pip" and leaving out the 3. What mountains must I move to perform such a basic task? I
python - How to run Pip commands from CMD - Stack Overflow
python - How to use pip in Windows? - Stack Overflow
How do I use pip?
How to...pip install?
Videos
Little side note for anyone new to Python who didn't figure it out by theirself: this should be automatic when installing Python, but just in case, note that to run Python using the python command in Windows' CMD you must first add it to the PATH environment variable, as explained here.
If you have the Python launcher installed, in such case instead of typing python in the console you can type py. Whether or not one or both commands are available depends on the choices you made during installation.
To execute Pip, first of all make sure you have it installed, so type in your CMD:
> python
>>> import pip
>>>
The above should proceed with no error. Otherwise, if this fails, you can look here to see how to install it. Now that you are sure you've got Pip, you can run it from CMD with Python using the -m (module) parameter, like this:
> python -m pip <command> <args>
Where <command> is any Pip command you want to run, and <args> are its relative arguments, separated by spaces.
For example, to install a package:
> python -m pip install <package-name>
Newer versions of Python come with py, the Python Launcher, which is always in the PATH.
Here is how to invoke pip via py:
py -m pip install <packagename>
py allows having several versions of Python on the same machine.
As an example, here is how to invoke the pip from Python 2.7:
py -2.7 -m pip install <packagename>
» pip install pip
You have to execute that command in a windows command prompt, not in a python shell.
How do I install pip on Windows?
This installed Pip at C:\Python27\Scripts\pip.exe. Find pip.exe on your computer, then add its folder (for example, C:\Python27\Scripts) to your path (Start / Edit environment variables). Now you should be able to run pip from the command line. Try installing a package:
pip install httpie