Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

importing lightcurve and net under Python 2 ends the world #2122

Closed
Cadair opened this issue Jun 2, 2017 · 5 comments
Closed

importing lightcurve and net under Python 2 ends the world #2122

Cadair opened this issue Jun 2, 2017 · 5 comments
Labels
Bug Probably a bug

Comments

@Cadair
Copy link
Member

Cadair commented Jun 2, 2017

ipython

In [1]: from sunpy.lightcurve import GOESLightCurve
   ...: from sunpy.net import hek
   ...: 
WARNING: AstropyDeprecationWarning: As of v0.8.0, the `sunpy.wcs` module is deprecated and will be removed in a future version. Use `sunpy.coordinates` or `sunpy.map` for coordinate transformations. [sunpy.wcs]
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-913dc430db3e> in <module>()
      1 from sunpy.lightcurve import GOESLightCurve
----> 2 from sunpy.net import hek

/home/stuart/Git/sunpy/sunpy/net/__init__.py in <module>()
      3 __all__ = ["Fido"]
      4 
----> 5 from sunpy.net.fido_factory import Fido

/home/stuart/Git/sunpy/sunpy/net/fido_factory.py in <module>()
     21 from .dataretriever.client import QueryResponse
     22 from .vso import VSOClient
---> 23 from . import attr
     24 from . import attrs as a
     25 

ImportError: cannot import name attr

However the following works:

ipython

In [1]: from sunpy.net import hek
WARNING: AstropyDeprecationWarning: As of v0.8.0, the `sunpy.wcs` module is deprecated and will be removed in a future version. Use `sunpy.coordinates` or `sunpy.map` for coordinate transformations. [sunpy.wcs]

In [2]: from sunpy.lightcurve import GOESLightCurve

I don't even know who I am any more.

@Cadair Cadair added the Bug Probably a bug label Jun 2, 2017
@aringlis
Copy link
Member

aringlis commented Jun 2, 2017

Weird - I get the same error, but if you swap the order of the commands, it works fine:

ln [1]: from sunpy.net import hek
ln [2]: from sunpy.lightcurve import GOESLightCurve
In [3]: 

@Cadair
Copy link
Member Author

Cadair commented Jun 2, 2017

@aringlis yeah...

It also seems to happen with sunpy.timeseries as well.

@Cadair
Copy link
Member Author

Cadair commented Jun 2, 2017

>>> import sunpy.timeseries
WARNING: AstropyDeprecationWarning: As of v0.8.0, the `sunpy.wcs` module is deprecated and will be removed in a future version. Use `sunpy.coordinates` or `sunpy.map` for coordinate transformations. [sunpy.wcs]
>>> from sunpy.net import hek
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/stuart/Git/sunpy/sunpy/net/__init__.py", line 5, in <module>
    from sunpy.net.fido_factory import Fido
  File "/home/stuart/Git/sunpy/sunpy/net/fido_factory.py", line 23, in <module>
    from . import attr
ImportError: cannot import name attr

@Cadair
Copy link
Member Author

Cadair commented Jun 2, 2017

I am therefore assuming that it's something in one of the old lightcurve source files.

@nabobalis
Copy link
Contributor

While this is a bug, I don't think we will fix it and with master now 3.6+, I will close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Probably a bug
Projects
None yet
Development

No branches or pull requests

3 participants