FAILURES: TestUtilMode.test_mode_pil_image -- conda update astropy
See original GitHub issueI 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:
- Created 6 years ago
- Comments:5 (5 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

A workaround was offered in #5590, so I’m closing this issue.
@astrofrog - Excellent, thanks ! @luciahh - Can you check when PIL was installed with this command ?