[AstroPy] ImportError: cannot import name _compiler
Erik Bray
embray at stsci.edu
Thu Jul 9 10:50:03 EDT 2015
It looks like you're still in the directory you unpacked the astropy source
into. Python adds the current working directory to your import path by default,
so if you're still in the source tree it will try to import from there, rather
than the version you installed. (Still odd since it should still work even then.)
Incidentally, unless you have a specific reason not to, you should use pip to
install Python packages:
pip install --user astropy
Erik
On 07/09/2015 08:47 AM, Steffen Brinkmann wrote:
> Hello,
>
> I just installed locally with
>
> $ python setup.py install --user
>
> Now when I import astropy, I get
>
>
>>>>
> In [1]: import astropy
> ---------------------------------------------------------------------------
> ImportError Traceback (most recent call last)
> <ipython-input-1-d192094ef7da> in <module>()
> ----> 1 import astropy
>
> /disk1/brinkmann/code/astropy-1.0.3/astropy/__init__.py in <module>()
> 323 log = _init_log()
> 324
> --> 325 _initialize_astropy()
> 326
> 327 from .utils.misc import find_api_page
>
> /disk1/brinkmann/code/astropy-1.0.3/astropy/__init__.py in
> _initialize_astropy()
> 236
> 237 try:
> --> 238 from .utils import _compiler
> 239 except ImportError:
> 240 if is_astropy_source_dir:
>
> ImportError: cannot import name _compiler
More information about the AstroPy
mailing list