Re: Python script can't find __future__ module

Posted by Alex-2 on
URL: http://imagej.273.s1.nabble.com/Python-script-can-t-find-future-module-tp5020940p5020944.html

Albert,
Thanks so much for your help.  I’m not 100% sure I’m following.  How does one go about upgrading Jython for ImageJ 1.5.3?  It appears Jython.jar includes Jython 2.5. (https://imagej.nih.gov/ij/plugins/jython/index.html)  In addition import __future__ with_statement is specifically targeted at Python 2.5 as it’s not compatible with previous versions and included with versions >=2.6. (https://stackoverflow.com/questions/3791903/which-python-version-needs-from-future-import-with-statement#3792223)
I appreciate the helpAlex



Sent from Yahoo Mail for iPhone


On Monday, July 9, 2018, 3:12 PM, Albert Cardona <[hidden email]> wrote:

You may need to install jython 2.7 from the corresponding update site.

> On Jul 9, 2018, at 10:29 AM, Alex <[hidden email]> wrote:
>
> I'm trying to import with_statement from __future__ but get the following error:
> Traceback (most recent call last):
>  File "<string>", line 1, in <module>
> ImportError: No module named __future__
>
> Currently using ImageJ 1.52e.
> Is this expected?  Examples here (https://imagej.net/Jython_Scripting) show the import from __future__
> ThanksAlex
>
>
>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html



--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html