0

While installing I faced syntax error:

>>> pip3 install numpy

File "", line 1 pip3 install numpy ^ SyntaxError: invalid syntax

>>> pip install -U scikit-learn

File "", line 1 pip install -U scikit-learn ^ SyntaxError: invalid syntax

Please tell me how to install the packages required and if I am missing any pre-requisites.

Vaidehi
  • 145
  • 12
  • 6
    You're typing those commands at the Python prompt. `pip` is not a Python command. Issue `pip` commands at a shell prompt. – kindall May 30 '18 at 17:40
  • 1
    To add to the comment by @kindall, if you do want to install packages from within iPython you can check out [this thread](https://stackoverflow.com/questions/8663046/how-to-install-a-python-package-from-within-ipython). – Mihai Chelaru May 30 '18 at 17:42
  • @kindall Thank you. – Vaidehi Jun 04 '18 at 18:48

1 Answers1

1

You need to use the pip command in a terminal or cmd instead of the Python prompt.

Open a terminal or command prompt and just type

pip3 install numpy
ltd9938
  • 1,444
  • 1
  • 15
  • 29