0

I want to install pandas in atom, however when I run import pandas as pd

I get ImportError: No module named pandas

I'm confused why because I definitely have pandas downloaded (checked through pip --freeze)

when I type python --version I get

Python 2.7.16 :: Anaconda, Inc.

Other answers to similar questions have suggested the problem is that pandas is installed on a different version of python. However, when I run

python2 -m pip install pandas

I get

Requirement already satisfied: pandas in ./opt/anaconda2/lib/python2.7/site-packages (0.24.2)

if pandas is downloaded to python 2.7 and im running python 2.7, I don't understand why it says it can't be found when trying to install it.

  • 1
    don't you mean 'import pandas as pd' instead of 'install pandas as pd' – Sander van den Oord Nov 07 '19 at 18:29
  • 1
    You can even have two versions of python2.7 installed at different locations. The python you run seems to come from anaconda, you could try installing pandas there with https://anaconda.org/anaconda/pandas Generally recommended to use some sort of environment when it comes to python to make sure you know what version (and from where) you are running – sedavidw Nov 07 '19 at 18:51

1 Answers1

0

It seems you have two different installations of python in your system, one installed via anaconda and another, probably system default.

Try conda install pandas instead, since your system is defaulting to the anaconda installation.

Or you could try going back to the default system installation which has already been covered in StackOverflow.

cozek
  • 755
  • 6
  • 9