I am a new user to python and I am trying to install a package in Visual Code using anaconda. I type in the following code
pip install pandas-dedupe
But I receive this error
/Users/nathang./anaconda3/bin/python /Users/nathang./Desktop/python/example.py
File "/Users/nathang./Desktop/python/example.py", line 1
pip install pandas-dedupe
^^^^^^^
SyntaxError: invalid syntax
(base) nathang.@MacBook-Pro python %
Any help would be appreciated as I have been trying to figure this out for a few hours.
pipis meant to be used from the terminal, you are typing it into a script (example.py).From within VSCode press ⌘+J (Ctrl+J on Windows) which will open a panel on the bottom of the window. Press the
Terminaltab and type your commandpip install pandas-dedupein the terminal which opens.