ImportError: C extension for ANA is missing, please rebuild

17 views
Skip to first unread message

Pete Riley

unread,
Jul 20, 2017, 5:46:07 PM7/20/17
to SunPy
Hi, 

I've installed SunPy and ran the self test, but get a number of errors related to ana.py and test_ana.py. Here are a couple of them:


E           ImportError: C extension for ANA is missing, please rebuild


anaconda/lib/python2.7/site-packages/sunpy/io/ana.py:119: ImportError

___________________________________________ test_i16c ___________________________________________


    @skip_ana

    def test_i16c():

        # Test int 16 compressed functions

        afilename = tempfile.NamedTemporaryFile().name

>       ana.write(afilename, img_i16, 'testcase', 0)


anaconda/lib/python2.7/site-packages/sunpy/io/tests/test_ana.py:44: 



Perhaps related, or not, but when trying out some of the tutorial examples I get the following error. I'm not sure how to invoke the "download_sample_data(). It doesn't work as an "import". 

Thanks in advance for any guidance, Pete

>>> import sunpy.data.sample

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

  File "/Users/pete/anaconda/lib/python2.7/site-packages/sunpy/data/sample.py", line 16, in <module>

    raise ImportError("Sample data file(s) missing. Use sunpy.data.download_sample_data() to get them.")

ImportError: Sample data file(s) missing. Use sunpy.data.download_sample_data() to get them.

>>> 

>>> 

>>> import sunpy.data.download_sample_data()

  File "<stdin>", line 1

    import sunpy.data.download_sample_data()

                                          ^

SyntaxError: invalid syntax

Nabil Freij

unread,
Jul 21, 2017, 4:04:08 AM7/21/17
to su...@googlegroups.com
Hi Pete,

If I recall correctly, there are several cases where the ANA C extension is not compiled because we do not support it under all systems or python versions at the moment. You should be able to ignore those ANA warnings as long as you do not plan to use it. 

Regarding the sample data download, you need to do something like this:

>>> from sunpy.data import download_sample_data
>>> download_sample_data()

You can not call a function at import time.

Many thanks,
Nabil


--
You received this message because you are subscribed to the Google Groups "SunPy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sunpy+unsubscribe@googlegroups.com.
To post to this group, send email to su...@googlegroups.com.
Visit this group at https://groups.google.com/group/sunpy.
For more options, visit https://groups.google.com/d/optout.

Stuart Mumford

unread,
Jul 21, 2017, 4:29:38 AM7/21/17
to su...@googlegroups.com

Hi Pete,

By what method did you install SunPy? You should not be getting that error, because if you installed on windows where we don't support ANA it should be disabled.

Stuart

To unsubscribe from this group and stop receiving emails from it, send an email to sunpy+un...@googlegroups.com.

Pete Riley

unread,
Jul 21, 2017, 3:44:21 PM7/21/17
to SunPy
Hi Nabil, 

Perfect, thanks  - that'll what it took to fix it. 

Pete
To unsubscribe from this group and stop receiving emails from it, send an email to sunpy+un...@googlegroups.com.

Pete Riley

unread,
Jul 21, 2017, 3:45:50 PM7/21/17
to SunPy
Hi Stuart, 

I installed it following conda:

conda install sunpy

I'm running it on OS X Sierra. 

Cheers, Pete
To unsubscribe from this group and stop receiving emails from it, send an email to sunpy+un...@googlegroups.com.
To post to this group, send email to su...@googlegroups.com.
Visit this group at https://groups.google.com/group/sunpy.
For more options, visit https://groups.google.com/d/optout.

Nabil Freij

unread,
Jul 21, 2017, 3:55:25 PM7/21/17
to su...@googlegroups.com
Hi Pete,

Theoretically the ANA extension should compile on MacOS but the lack of my own test platform makes it difficult to test fully. Sorry about the problems you're having with it! 

Kind regards,
Nabil

To unsubscribe from this group and stop receiving emails from it, send an email to sunpy+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages