ImportError: No module named astropy, after installing astropy in Anaconda

3.1k views Asked by At

So I am trying to work with Astropy and I definitely downloaded it. However, I am getting an error. I am trying to work in Python 2 rather than Python 3.

The code was just:

import astropy
astropy.test()

This is the error given:

Traceback (most recent call last):
  File "/Users/....../Random.py", line 1, in <module>
  import astropy
  ImportError: No module named astropy
2

There are 2 answers

3
AudioBubble On BEST ANSWER

Basically, the fix was removing Python 3.4, deleting directory, reinstalled 2.7 and Pypm Astropy. Not sure exactly what happened but that was the fix...

0
Tom Aldcroft On

Try a few things at the shell to examine your environment and possibly understand your problem:

which python
which conda
conda list