{"action":"created","issue":{"url":"https://api.github.com/repos/astropy/astropy/issues/3572","labels_url":"https://api.github.com/repos/astropy/astropy/issues/3572/labels{/name}","comments_url":"https://api.github.com/repos/astropy/astropy/issues/3572/comments","events_url":"https://api.github.com/repos/astropy/astropy/issues/3572/events","html_url":"https://github.com/astropy/astropy/issues/3572","id":59838229,"number":3572,"title":"Error: 'NoneType' object has no attribute 'NoWcsKeywordsFoundError'","user":{"login":"fergalm","id":1650523,"avatar_url":"https://avatars.githubusercontent.com/u/1650523?v=3","gravatar_id":"","url":"https://api.github.com/users/fergalm","html_url":"https://github.com/fergalm","followers_url":"https://api.github.com/users/fergalm/followers","following_url":"https://api.github.com/users/fergalm/following{/other_user}","gists_url":"https://api.github.com/users/fergalm/gists{/gist_id}","starred_url":"https://api.github.com/users/fergalm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fergalm/subscriptions","organizations_url":"https://api.github.com/users/fergalm/orgs","repos_url":"https://api.github.com/users/fergalm/repos","events_url":"https://api.github.com/users/fergalm/events{/privacy}","received_events_url":"https://api.github.com/users/fergalm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-04T18:17:29Z","updated_at":"2015-03-04T18:30:44Z","closed_at":null,"body":"My code is raising an attribute error that I don't believe should happen.\r\n\r\n```\r\n/home/fmullall/all/kepler/twowheel/whereToPoint/optimalField/optimalField.py in doPlotFc(img, hdr, ra_deg, dec_deg, cat)\r\n    339     #Draw 35 pix circle\r\n    340     radius_deg = 70/3600.\r\n--> 341     w = wcs.WCS(hdr)\r\n    342\r\n    343\r\n\r\n/home/fmullall/.local/lib64/python2.7/site-packages/astropy-0.2.3-py2.7-linux-x86_64.egg/astropy/wcs/wcs.pyc in __init__(self, header, fobj, key, minerr, relax, naxis, keysel, colsel, fix)\r\n    312                                      relax=relax, keysel=keysel_flags,\r\n    313                                      colsel=colsel)\r\n--> 314             except _wcs.NoWcsKeywordsFoundError:\r\n    315                 # The header may have SIP or distortions, but no core\r\n    316                 # WCS.  That isn't an error -- we want a \"default\"\r\n\r\nAttributeError: 'NoneType' object has no attribute 'NoWcsKeywordsFoundError'\r\n```\r\n\r\nLooking at the code, I suspect the problem starts near the top of wcs.py\r\n```\r\ntry:\r\n    from . import _wcs\r\nexcept ImportError:\r\n    _wcs = None\r\n```\r\n\r\nThis problem, in turn, is probably due to my LD_LIBRARY_PATH not being set right, and python is unable to find _wcs.so. But if astropy can't find _wcs.so, shouldn't the error occur at that point, instead of much later when I try to use the code?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/astropy/astropy/issues/comments/77216173","html_url":"https://github.com/astropy/astropy/issues/3572#issuecomment-77216173","issue_url":"https://api.github.com/repos/astropy/astropy/issues/3572","id":77216173,"user":{"login":"fergalm","id":1650523,"avatar_url":"https://avatars.githubusercontent.com/u/1650523?v=3","gravatar_id":"","url":"https://api.github.com/users/fergalm","html_url":"https://github.com/fergalm","followers_url":"https://api.github.com/users/fergalm/followers","following_url":"https://api.github.com/users/fergalm/following{/other_user}","gists_url":"https://api.github.com/users/fergalm/gists{/gist_id}","starred_url":"https://api.github.com/users/fergalm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fergalm/subscriptions","organizations_url":"https://api.github.com/users/fergalm/orgs","repos_url":"https://api.github.com/users/fergalm/repos","events_url":"https://api.github.com/users/fergalm/events{/privacy}","received_events_url":"https://api.github.com/users/fergalm/received_events","type":"User","site_admin":false},"created_at":"2015-03-04T18:30:44Z","updated_at":"2015-03-04T18:30:44Z","body":"I'm using Anaconda. There's something particular about this machine because astropy and wcs have worked before for me on different boxes using Anaconda as the installer.\r\n\r\n_wcs.so did compile, as I can see it in the astropy directory:\r\n```\r\nls /home/fmullall/.local/lib64/python2.7/site-packages/astropy-0.2.3-py2.7-linux-x86_64.egg/astropy/wcs\r\ndocstrings.py*\r\ndocstrings.pyc\r\n_docutil.py*\r\n_docutil.pyc\r\ninclude/\r\n__init__.py*\r\n__init__.pyc\r\nsetup_package.py*\r\nsetup_package.pyc\r\ntests/\r\n_wcs.py*\r\nwcs.py*\r\n_wcs.pyc\r\nwcs.pyc\r\n_wcs.so*\r\n```\r\n\r\n\r\n"}}