Menu

Infinite loop when setting up Jython

2011-07-07
2013-03-15
  • Peter Keller

    Peter Keller - 2011-07-07

    OS: openSUSE 11.4
    Eclipse version: Helios SR1
    PyDev version 2.2.0
    Jython version: 2.2a0

    I tried to add a jython interpreter, using

    /usr/share/java/jython.jar
    

    as the interpreter. When I clicked "OK", an error window appeared that contained the following message:

    It seems that the Python /Lib folder (which contains the standard library) was not found/selected during the install process or the stdlib does not contain the required .py files (i.e.: only has .pyc files).

    This folder (which contains files such as threading.py and traceback.py) is required for PyDev to function properly (and it must contain the actual source files, not only .pyc files).

    Note that if this is a virtualenv install, the /Lib folder from the base install needs to be selected (unlike the site-packages which is optional).

    Clicking on "OK" in this window just brings it back. I tried clicking "OK" repeatedly, hoping that it would try a finite number of times and then give up, allowing me to specify the directory by hand, but this didn't work. In the end, I had to use xkill to kill this window, which terminated eclipse as well of course.

    First point: am I right in thinking that this is a bug in PyDev? Even if the Jython installation is odd in some way, at least there should be a way past this point so that I can tell it where to look for the required files if it can't find them on its own?

    Second point, the required files do seem to me to be present:

    [localhost]~-579 > ls /usr/share/jython/Lib
    ./         compileall.py    glob.py        macurl2path.py  popen2.py     SimpleHTTPServer.py  tzparse.py
    ../        ConfigParser.py  gopherlib.py       mailbox.py      poplib.py     site.py          unittest.py
    aifc.py        Cookie.py        gzip.py        mailcap.py      posixfile.py  smtplib.py       urllib2.py
    anydbm.py      copy.py      hmac.py        markupbase.py   posixpath.py  sndhdr.py        urllib.py
    atexit.py      copy_reg.py      htmlentitydefs.py  marshal.py      pprint.py     socket.py        urlparse.py
    base64.py      dbexts.py        htmllib.py         mhlib.py        profile.py    SocketServer.py      UserList.py
    BaseHTTPServer.py  difflib.py       HTMLParser.py      mimetools.py    pstats.py     sre_compile.py   user.py
    bdb.py         dircache.py      httplib.py         mimetypes.py    pyclbr.py     sre_constants.py     UserString.py
    binhex.py      doctest.py       imaplib.py         MimeWriter.py   Queue.py      sre_parse.py     uu.py
    bisect.py      dospath.py       imghdr.py          mimify.py       quopri.py     sre.py       warnings.py
    calendar.py    dumbdbm.py       inspect.py         multifile.py    random.py     stat.py          weakref.py
    CGIHTTPServer.py   email/       isql.py        mutex.py        reconvert.py  StringIO.py      whichdb.py
    cgi.py         encodings/       javaos.py          netrc.py        repr.py       string.py        whrandom.py
    chunk.py       fileinput.py     javapath.py        nntplib.py      re.py         symbol.py        xdrlib.py
    cmd.py         fnmatch.py       javashell.py       ntpath.py       rfc822.py     telnetlib.py     xmllib.py
    codecs.py      formatter.py     jreload.py         nturl2path.py   sched.py      tempfile.py      xmlrpclib.py
    codeop.py      fpformat.py      jxxload_help/      pawt/           sgmllib.py    threading.py     zipfile.py
    code.py        ftplib.py        keyword.py         pdb.py          shelve.py     tokenize.py      zlib.py
    colorsys.py    __future__.py    linecache.py       pickle.py       shlex.py      token.py
    commands.py    getopt.py        macpath.py         pipes.py        shutil.py     traceback.py
    
     
  • Fabio Zadrozny

    Fabio Zadrozny - 2011-07-08

    I think PyDev could be improved to handle the case where your code is not found in sys.path after starting up Jython… Please enter a bug report for that.

    As for your current workaround, edit org.python.pydev\PySrc\interpreterInfo.py and after the path_used = sys.path, do path_used.append('/usr/share/jython/Lib') and try to add the interpreter again (it should work this time).

    Cheers,

    Fabio

     
  • uzi

    uzi - 2011-07-08

    downgrade to 1.6.5.
    BTW when opening a workspace that has been used with this version, the latest version of pydev can be used..

     
  • uzi

    uzi - 2011-07-08

    this doesn't work. downgrading to 1.6.5 does.
    when opening the workspace that has been used with this version of pydev, the latest version of pydev can be used..

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.