Python - How do I run pip on windows?

preview_player
Показать описание
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

Why does “pip install” inside Python raise a SyntaxError?
Рекомендации по теме
Комментарии
Автор

Interesting with 3.7 I get "has no attribute 'main'. Great info btw!

edwardkehoe
Автор

>>> pip.main(['install', 'requests'])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'main'

Shonebyt
Автор

no this is the error
Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
pip.main(['install', 'requests'])
AttributeError: module 'pip' has no attribute 'main'

jyotigupta-beoy
Автор

i am so fed up nothing works i am soo angry i am sitting here for hours and nothing is working this neither

michelbruns
Автор

Did not show how to install a module with an example

guatechino