Python - How do I run pip on windows?

Опубликовано: 14 Апрель 2026
на канале: Maruti AIR Tech
7,730
55

pip is a module in the standard library, but it isn't a built-in function(or module), thus you need import it.

pip is run from the cmd line, not from Python interpreter. It is a cmd that installs modules so you can use them in Python. Once you have installed a module, then you can open the Python shell use it.

The Python shell is not a command line, it is an interactive interpreter. You type Python code into it, not the commands.



Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 16:07:46) [MSC v.1900 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.

pip

Traceback (most recent call last):
File " pyshell#0", line 1, in module
pip
NameError: name 'pip' is not defined

import pip

pip.main(['install','requests'])







Why does “pip install” inside Python raise a SyntaxError?