How do I run pip on python for windows?

How do I run pip on python for windows?

Maybe youd like try run pip in Python shell like this:

>>> import pip
>>> pip.main([install, requests])

This will install requests package using pip.


Because pip is a module in standard library, but it isnt a built-in function(or module), so you need import it.

Other way, you should run pip in system shell(cmd. If pip is in path).

I have a Mac, but luckily this should work the same way:

pip is a command-line thing. You dont run it in python.

For example, on my Mac, I just say:

$pip install somelib

pretty easy!

How do I run pip on python for windows?

First go to the pip documentation if not install before:
http://pip.readthedocs.org/en/stable/installing/

and follow the install pip which is first download get-pip.py from
https://bootstrap.pypa.io/get-pip.py

Then run the following (which may require administrator access):
python get-pip.py

Leave a Reply

Your email address will not be published.