question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FAILURES: TestUtilMode.test_mode_pil_image -- conda update astropy

See original GitHub issue

I have updated my astropy version running

> conda update astropy 

Then, to test the installed version of astropy I ran the function astropy.test() and I got this error:

========================================================================== FAILURES ==========================================================================
______________________________________________________________ TestUtilMode.test_mode_pil_image ______________________________________________________________

self = <astropy.io.fits.tests.test_util.TestUtilMode object at 0x1181cb190>

    @pytest.mark.skipif("not HAS_PIL")
    def test_mode_pil_image(self):
        img = np.random.randint(0, 255, (5, 5, 3)).astype(np.uint8)
        result = Image.fromarray(img)
    
        result.save(self.temp('test_simple.jpg'))
        # PIL doesn't support append mode. So it will allways use binary read.
>       with Image.open(self.temp('test_simple.jpg')) as fileobj:

anaconda/lib/python2.7/site-packages/astropy/io/fits/tests/test_util.py:91: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=5x5 at 0x112DBF8C0>, name = '__exit__'

    def __getattr__(self, name):
        if name == "__array_interface__":
            # numpy array interface support
            new = {}
            shape, typestr = _conv_type_shape(self)
            new['shape'] = shape
            new['typestr'] = typestr
            new['data'] = self.tostring()
            return new
>       raise AttributeError(name)
E       AttributeError: __exit__

anaconda/lib/python2.7/site-packages/PIL/Image.py:512: AttributeError
======================================== 1 failed, 11357 passed, 177 skipped, 43 xfailed, 3 xpassed in 387.18 seconds ========================================
1

Is there something I can do to fix the problem?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
bsipoczcommented, Aug 2, 2017

A workaround was offered in #5590, so I’m closing this issue.

0reactions
saimncommented, Jun 3, 2017

@astrofrog - Excellent, thanks ! @luciahh - Can you check when PIL was installed with this command ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Known Issues — Astropy v5.2
Anaconda Users Should Upgrade with conda , Not pip. Locale Errors in MacOS X and Linux. Failing Logging Tests When Running the Tests...
Read more >
Failed test astropy.test() in Anaconda · Issue #8689 - GitHub
Running tests in /opt/anaconda/2-5.3/lib/py. ... Please either upgrade your python and astropy versions, or downgrade pytest to <3.7 in your ...
Read more >
Known Issues — Astropy v3.2.dev994
Anaconda users should upgrade with conda , not pip; Locale errors in MacOS X and Linux; Creating a Time object fails with ValueError...
Read more >
Known Issues — Astropy v1.0.4
Anaconda users should upgrade with conda, not pip; Locale errors in MacOS X and Linux; Creating a Time object fails with ValueError after...
Read more >
Astropy - :: Anaconda.org
The Astropy Project is a community effort to develop a single package for Astronomy in Python. It contains core functionality and common tools...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found