Search code examples
pythonpandasanacondapython-dedupe

Installing python pacakages in Mac


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.


Solution

  • pip is 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 Terminal tab and type your command pip install pandas-dedupe in the terminal which opens.