Login  Register

Re: Python/Jython code that doesn't work in ImageJ

Posted by Leon Espinosa-3 on Jul 08, 2014; 7:34am
URL: http://imagej.273.s1.nabble.com/Python-Jython-code-that-doesn-t-work-in-ImageJ-tp5008609p5008615.html

Dear Daniel, I had problems with Jython in Fiji that were solved with the advice of Brian Northan (see below, the discussions was started in this list around May 6 2014 with "new error in  python script" subject). You need also import each python and ImageJ class. Hope it helps...


>
Hi Leon

I got the same thing.  I believe it is because of a conflict between
components packaged with both jython and jruby.

jruby was updated recently.   When I deleted ruby-complete-1.7.11.jar from
the jars directory the jython scripts started working again.  This is a
hack though because then jruby doesn't work.

Brian
>


All the best, Leon








Le 7 juil. 2014 à 23:01, J. Daniel Fenn a écrit :

> The following code works fine on my desktop version of python (2.7) but
> it does not work using the ImageJ/Fiji code editor (which I believe is
> using python 2.5.2)
>
>
> dirRawIn = os.path.join(dirBase, dirRaw)
> dirAnlOut = os.path.join(dirBase, dirAnl)
> dirMntOut = os.path.join(dirBase, dirMnt)
>
> def mkdir_p(path):
>    print path
>    try:
>        os.makedirs(path)
>    except OSError, exc:
>        if exc.errno == errno.EEXIST and os.path.isdir(path):
>            pass
>        else:
>            raise
>
> mkdir_p(dirAnlOut)
> mkdir_p(dirMntOut)
>
>
> I'm pretty sure everything I've read suggests that code should work even
> on python 2.5.  Does anyone have any ideas why this code doesn't work
> within Fiji?
>
> I just get a huge block of Traceback error text that doesn't give me any
> real information.  I can post if it is needed.
>
> Thanks
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

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