Re: [Matplotlib-users] Best way to display image from URL in Python3

2015-03-20 Thread Benjamin Root
According to the PR you reference, the fix for this was merged back in Jan 2013, so that means that this fix is in version 1.2.x and up. Are you saying that you still can't do imread(urllib.request.urlopen(url))? On Thu, Mar 19, 2015 at 8:54 PM, Ryan Nelson rnelsonc...@gmail.com wrote: Hello

Re: [Matplotlib-users] Best way to display image from URL in Python3

2015-03-20 Thread Ryan Nelson
For me, if I change the script from the PR to what is shown below, everything works fine in both Python 2.7 and 3.4 (Anaconda environments, everything updated): ## url = 'http://www.libpng.org/pub/png/img_png/pngnow.png' try: import urllib2 data = urllib2.urlopen(url)

Re: [Matplotlib-users] Best way to display image from URL in Python3

2015-03-20 Thread Ryan Nelson
Thanks, Ben. I should have made that more clear. If I run the code from the PR, I get the following error: Traceback (most recent call last): File junk.py, line 11, in module image = pyplot.imread(data) # crash on py3.x File

Re: [Matplotlib-users] Best way to display image from URL in Python3

2015-03-20 Thread Thomas Caswell
I think `six` (which we use to smooth over the 2/3 changes) has a way of dealing with atleast the urllib renaming . On Fri, Mar 20, 2015 at 11:58 AM Ryan Nelson rnelsonc...@gmail.com wrote: For me, if I change the script from the PR to what is shown below, everything works fine in both Python

Re: [Matplotlib-users] Best way to display image from URL in Python3

2015-03-20 Thread Ryan Nelson
I can understand that switching from Py 2 to 3 is going to require a change from urllib2.urlopen to urllib.requests.urlopen, but the addition of BytesIO and read() makes the transition tricky. It was not obvious to me why that wouldn't work right off the bat, which is why I had to dig up that PR

Re: [Matplotlib-users] Best way to display image from URL in Python3

2015-03-20 Thread Ryan Nelson
A little update. It seems that this seems to be specific to Linux in some way. I tried the original script from the PR under a couple of conditions: * on Windows 7 Anaconda Python 2.7 and 3.4 -- everything works both versions * on Anaconda Python 2.7 and 3.4 Linux version -- only the 2.7 version

Re: [Matplotlib-users] Best way to display image from URL in Python3

2015-03-20 Thread Ryan Nelson
Thomas, sorry I missed your email. I'll see if I can get a PR pulled together soon-ish. Ryan On Fri, Mar 20, 2015 at 4:32 PM, Ryan Nelson rnelsonc...@gmail.com wrote: A little update. It seems that this seems to be specific to Linux in some way. I tried the original script from the PR under

Re: [Matplotlib-users] Best way to display image from URL in Python3

2015-03-20 Thread Jerzy Karczmarczuk
Le 20/03/2015 16:57, Ryan Nelson a écrit : For me, if I change the script from the PR to what is shown below, everything works fine in both Python 2.7 and 3.4 (Anaconda environments, everything updated): ## url = 'http://www.libpng.org/pub/png/img_png/pngnow.png' try:

Re: [Matplotlib-users] Best way to display image from URL in Python3

2015-03-20 Thread Thomas Caswell
Despite my grumping earlier, a PR that makes URLs just work is probably a good idea and would be merged. Tom On Fri, Mar 20, 2015 at 3:59 PM Jerzy Karczmarczuk jerzy.karczmarc...@unicaen.fr wrote: Le 20/03/2015 16:57, Ryan Nelson a écrit : For me, if I change the script from the PR to what