-3

I am trying to install pip for Python 3.4, it says "invalid syntax" to install command?

Here is the command list:

>>> pip install
SyntaxError: invalid syntax
>>> pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew
SyntaxError: invalid syntax
>>> pip install kivy.deps.gstreamer --extra-index-url https://kivy.org/downloads/packages/simple/
SyntaxError: invalid syntax
>>> pip install kivy
SyntaxError: invalid syntax
>>> import kivy
Traceback (most recent call last):
  File "<pyshell#6>", line 1, in <module>
    import kivy
ImportError: No module named 'kivy'
BlackJack
  • 4,476
  • 1
  • 20
  • 25
Sam
  • 11
  • 3
  • 1
    Please check your question formatting before posting. You may create a code block by selecting text and clicking the `{}` button. Please [edit] to fix – OneCricketeer May 22 '16 at 13:35
  • 6
    You should run pip in your terminal, not in the Python interpreter – Railslide May 22 '16 at 13:38
  • For the next time you should definitely read the [docs](https://kivy.org/docs/installation/installation.html). In windows and mac parts there are commands written properly so that you could copy&paste for your console/terminal and it'd install. Did you by any change try to install it through `idle` console or something? – Peter Badida May 22 '16 at 18:32
  • https://stackoverflow.com/search?q=%5Bpip%5D+SyntaxError – phd Oct 31 '21 at 15:06

1 Answers1

2

Since the prompt looks like >>>, it seems you are running it in the python shell or interpreter. That is not how pip is supposed to be run. It is installed on the system path, so it is a command that the terminal can execute. Syntax looks like this:

For Linux:

pip install [packages]

For windows:

python -m pip install [packages]

Run these in your system terminal, and it should work (as long as my syntax is correct).

Ecko
  • 1,030
  • 9
  • 30