Skip to content

import coordinates: cannot import name sofa_time - #864

Merged
embray merged 1 commit into
astropy:masterfrom
embray:issue-864
Mar 29, 2013
Merged

embray merged 1 commit into
astropy:masterfrom
embray:issue-864

Conversation

@embray

@embray embray commented Mar 27, 2013

Copy link
Copy Markdown
Member

I have installed astropy-0.2 on a mac.

from astropy import coordinates  gives these errors:
RROR: ImportError: cannot import name sofa_time [unknown]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "astropy/coordinates/__init__.py", line 14, in <module>
    from .builtin_systems import *
  File "astropy/coordinates/builtin_systems.py", line 12, in <module>
    from ..time import Time
  File "astropy/time/__init__.py", line 2, in <module>
    from .core import *
  File "astropy/time/core.py", line 25, in <module>
    from . import sofa_time
ImportError: cannot import name sofa_time

my python version info is:

Python 2.7.3 |EPD 7.3-2 (64-bit)| (default, Apr 12 2012, 11:14:05)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin

I am using MacOS Mountain Lion: 10.8.2

@adrn

adrn commented Mar 11, 2013

Copy link
Copy Markdown
Member

Are you installing from source or pip? Can you copy and paste the installation command you used? e.g.

pip install astropy

or

python setup.py install

What your current working directory? e.g. what is the output from pwd?

@astrofrog

Copy link
Copy Markdown
Member

@richardgmcmahon - it looks like you may have tried to import astropy from the source directory, which won't work unless you installed with python setup.py build_ext --inplace. If you just use python setup.py install, then you have to make sure you are in a different directory before importing. Can you confirm whether the import works if you change directory?

@richardgmcmahon

Copy link
Copy Markdown
Author

I installed with python setup.py install

OK, yes, I had tried it while still in the source directory. When I changed directory, it worked OK.

Thanks for the responses.

@embray

embray commented Mar 21, 2013

Copy link
Copy Markdown
Member

I wonder thought if it might be worth putting something in astropy/__init__.py to prevent this. I mean, not to prevent imports altogether. But just to try importing an extension module and, if it fails, output a more useful error message.

@embray embray reopened this Mar 21, 2013
@astrofrog

Copy link
Copy Markdown
Member

@iguananaut - I agree, this would be a good idea.

@ghost ghost assigned embray Mar 22, 2013
@embray

embray commented Mar 22, 2013

Copy link
Copy Markdown
Member

I'll handle this then. I would consider it a bug.

@embray

embray commented Mar 29, 2013

Copy link
Copy Markdown
Member

The one failure in Travis seems to be the docs issue that I've been hearing reference to elsewhere, and shouldn't be a result of this PR. So I'll merge after a rebase.

… if some extension modules outright failed to compile--that is, this doesn't help with a broken installation. Just with the not too uncommon case of someone trying to 'import astropy' from a source checkout
embray added a commit that referenced this pull request Mar 29, 2013
import coordinates: cannot import name sofa_time
@embray
embray merged commit 3e5a463 into astropy:master Mar 29, 2013
@embray
embray deleted the issue-864 branch March 29, 2013 23:31
embray added a commit that referenced this pull request Apr 1, 2013
import coordinates: cannot import name sofa_time
embray added a commit that referenced this pull request Apr 1, 2013
embray added a commit that referenced this pull request Apr 1, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants