skip to Main Content

I am rather new to programming. Right now, I am using vsc to code on OS X (the same error occurs in Terminal). But for whatever reason, I can’t use my modules in python; I tried different ones, like pandas or numpy. I always get the same error:

ModuleNotFoundError: No module named ‘pandas’

I tried to update and reinstall the modules, pip, and python. Now I am out of ideas. Does anyone have an Idea on how to fix that?

I tried to import modules:
import pandas as pd

But got the error:

ModuleNotFoundError: No module named ‘pandas’

3

Answers


  1. Try to run pip list in your shell and see if pandas is printed.

    If not, it means that it has not been installed. See there for instalation instructions.

    See also the VS Code doc about Python and selection of interpreters.

    Login or Signup to reply.
  2. you can use

    pip install module_name
    

    in your case

    pip install pandas
    

    and then to verify if your panda is installed well you can check it by :

    # display pandas details
    pip show pandas
    

    you will have an output like this :

    Output:
    
        Name: pandas
    
        Version: 1.1.5
    

    then you can import your panda library

    Login or Signup to reply.
  3. Have you checked whether you chose the correct python Interpreter?

    Use shortcuts Ctrl+Shift+P and search for "Python:Select Interpreter" to check it.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search