0

I don't understand how to install packages in python. I just continually get SyntaxError: invalid syntax regardless of the various commands I try. I have seen that I cannot write commands from the shell, but am not sure where else I would do this. help

>>> python3 pip install requests
SyntaxError: invalid syntax
doelleri
  • 19,232
  • 5
  • 61
  • 65

1 Answers1

0

You have to run the pip3 install requests on your terminal/shell and not inside your python interpreter. The pip3 is used if the you are using version python 3.

Once the package is installed, you can use import requeststo include it to your .py file.

Feel free to comment and ask for any further help with this. If you need help with installing pip itself, refer to this link.

Hades1598
  • 320
  • 1
  • 7