pip install pandas conflict with Pylance

Viewed 998

"pip is not defined" "install is not defined" "pandas is not defined"

I'm trying to install pandas into VSCode since I received a "ModuleNotFoundError" from trying to import pandas in the first place.

2 Answers

So i do not have the knowledge to go in the details to explain why pip is particular but pip is an executable so you have to execute it in a terminal. to install pandas (or any other module from pyPI like sklearn, seaborn, time and many others) follow the instruction (it works for me):

  • go on VScode and open a new terminal (Terminal - New or Ctrl+J)
  • you should have a line with your current folder like C:\documents.......>
  • Type a the end of this line python -m pip install pandas

pip should install pandas automatically.

If it tells you an error message as it's impossible to find python.exe it may be due to the fact that python.exe isn't listed in your path (check other subjects on this "how to add python to path" for example)

Once pandas is installed, if you want to use it in your code you don't need to re-install it each time, juste use import pandasat the beginning of your code

It should be like this:

enter image description here

pip should be executed in the terminal.

Related