'ImportError when using pip install

I tried installing 'pandas' and 'xlrd' using pip install but I get this error from python when I try and use the modules: ImportError: No module named xlrd. Same error when I use pandas. I have tried various methods from the internet to solve this issue including:

  • changing package permissions
  • using sudo pip install
  • adding PYTHONPATH export in the bash_profile file.
  • using pip3 because I have python 3

I even tried this approach https://stackoverflow.com/a/49602260, but in my case I already had the package location(which I got using pip show xlrd) inside the sys.path list.

None of the above approaches have worked for me.

Edit: I use VSCode as my IDE and I run my files through the inbuilt terminal.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source