Python – Pandas installed, but cannot be found? Why is that


I have installed Anaconda, so I'm fairly sure I have installed Pandas.

However, when I run this in Sublime:

import pandas as pd

I get this message:

Traceback (most recent call last):
  File "/Users/user/Documents/Programming/Python/Python for Finance/", line 184, in <module>
    import pandas as pd
ImportError: No module named pandas
[Finished in 0.4s with exit code 1]

But when I go to the terminal:

Python 2.7.8 |Anaconda 2.1.0 (x86_64)| (default, Aug 21 2014, 15:21:46) 
[GCC 4.2.1 (Apple Inc. build 5577)] on darwin
>>> import pandas
>>> import pandas as pd
>>> pd.__version__

So I know I have pandas, and I've also updated anaconda to the newest version….

Chef-3:~ user$ conda update anaconda Fetching package metadata: ..
# All requested packages already installed.
# packages in environment at /Users/user/anaconda:
# anaconda                  2.1.0                np19py27_0

So what am I missing?

Thanks 🙂

Best Solution

I ran into the same problem with PyCharm a few weeks ago. My solution, if all else fails, is to move over to iPython Notebook. Since that runs Anaconda, you know it will detect pandas successfully. For some reason (maybe the reason @DSM mentioned), sometimes installing a package on Anaconda doesn't transfer over to all of your IDEs.

Related Question