ImportError: No module named version in Astropy
Question: I currently have an anaconda installation of of Python, which includes astropy
and numpy among other useful packages. I recently updated my Astropy
individually through pip, by running

    
    
    pip install --upgrade astropy
    

After this silly thing that I probably should not have done (I should have
upgrades the entire anaconda package), my pyspeckit package stopped working,
claiming it could not find the version.py in astropy. This is the error I get:

    
    
       /Users/saracamnasio/Research/code/MC_test.py in <module>()
          5 import utilities as u
          6 import BDdb
    ----> 7 import pyspeckit
          8 import StringIO
          9 import corner
    
    /Users/saracamnasio/Research/code/pyspeckit/pyspeckit/__init__.py in <module>()
          8 
          9 if not _ASTROPY_SETUP_:
    ---> 10     from version import version as __version__
         11     import spectrum
         12     import specwarnings
    
    ImportError: No module named version
    

I tried to uninstall and reinstall astropy, as well as update anaconda
independently but it's not working to fix it. Suggestions?


Answer: Evert's comment is most likely the correct answer: just update pyspeckit. The
version you're using is out of date and has some potential inconsistencies in
how it does relative imports.

However, what you have uncovered is, if not a bug, definitely not a feature,
so it will be removed soon:

<https://github.com/pyspeckit/pyspeckit/pull/134>

