Menu

ImportError: no module named threading

Ferry
2011-03-14
2013-03-15
  • Ferry

    Ferry - 2011-03-14

    Hello,
    I want to use Pydev with Jython in a grinder (see: http://grinder.sourceforge.net) environment.
    I configured in the Pydev preferences the jython.jar  which is packaged  in the latest version of grinder (3.4).

    Every time When I try code completion I get the following error:
    java.lang.RuntimeException: Error connecting to python process ( C:\SPARDAT\IMC\TOOLS\jdk150\bin\javaw.exe -Dpython.path=C:\testinfra\SPARDAT\IMC\Tools\eclipse\plugins\org.python.pydev_1.6.5.2011020317\PySrc\pydev_sitecustomize;C:\SPARDAT\IMC\TOOLS\jdk150\jre\lib\rt.jar;C:\SPARDAT\IMC\TOOLS\jdk150\jre\lib\jsse.jar;C:\SPARDAT\IMC\TOOLS\jdk150\jre\lib\jce.jar;C:\SPARDAT\IMC\TOOLS\jdk150\jre\lib\charsets.jar;C:\SPARDAT\IMC\TOOLS\jdk150\jre\lib\ext\dnsns.jar;C:\SPARDAT\IMC\TOOLS\jdk150\jre\lib\ext\localedata.jar;C:\SPARDAT\IMC\TOOLS\jdk150\jre\lib\ext\sunjce_provider.jar;C:\SPARDAT\IMC\TOOLS\jdk150\jre\lib\ext\sunpkcs11.jar;C:\testinfra\SPARDAT\IMC\Test\grinder\3_0_0_b30\lib\jython.jar -classpath C:\testinfra\SPARDAT\IMC\Test\grinder\3_4\lib\jython.jar;C:\testinfra\SPARDAT\IMC\Tools\eclipse\plugins\org.python.pydev_1.6.5.2011020317\PySrc\pydev_sitecustomize;C:\SPARDAT\IMC\TOOLS\jdk150\jre\lib\rt.jar;C:\SPARDAT\IMC\TOOLS\jdk150\jre\lib\jsse.jar;C:\SPARDAT\IMC\TOOLS\jdk150\jre\lib\jce.jar;C:\SPARDAT\IMC\TOOLS\jdk150\jre\lib\charsets.jar;C:\SPARDAT\IMC\TOOLS\jdk150\jre\lib\ext\dnsns.jar;C:\SPARDAT\IMC\TOOLS\jdk150\jre\lib\ext\localedata.jar;C:\SPARDAT\IMC\TOOLS\jdk150\jre\lib\ext\sunjce_provider.jar;C:\SPARDAT\IMC\TOOLS\jdk150\jre\lib\ext\sunpkcs11.jar;C:\testinfra\SPARDAT\IMC\Test\grinder\3_0_0_b30\lib\jython.jar  org.python.util.jython C:\testinfra\SPARDAT\IMC\Tools\eclipse\plugins\org.python.pydev_1.6.5.2011020317\PySrc\pycompletionserver.py 33898 33897)  - the process in NOT ALIVE anymore (output=-1) -  the output of the process is: Std output:

    Err output:
    Traceback (innermost last):

      File "C:\testinfra\SPARDAT\IMC\Tools\eclipse\plugins\org.python.pydev_1.6.5.2011020317\PySrc\pycompletionserver.py", line 31, in ?

    ImportError: no module named threading

    Have anyone an idea what goes wrong?

    regards ferry

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2011-03-14

    Well, it seems that the Jython /Lib folder is not in your pythonpath (and that's why you're having these problems). Please add the Jython /Lib folder to the pythonpath to fix that.

    Cheers,

    Fabio

     
  • Ferry

    Ferry - 2011-03-14

    Hello,
    Thx for the prompt reply.

    I have tried to configure pythonpath in the eclipse preferences  but it still doesn't work.
    is there any possibility to upload a screenshot?

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2011-03-14

    To provide a screenshot add it to a service (e.g.: http://imageshack.us/) and pass the link for it…

    Now, as for it not working, have you checked if threading.py is within the /Lib dir you added to the PYTHONPATH?

    Cheers,

    Fabio

     
  • Ferry

    Ferry - 2011-03-14

    When I create a new Pydev project I do the following configurations:

    pydev - Interpreter/Grammar:
    project type: Jython
    Grammar version: 2.2
    Interpreter: Jython

    After creation I got the following error:

    org.python.pydev.core.NotConfiguredInterpreterException: PythonInterpreterManager:Interpreter is not properly configured!
    Please go to window > preferences > PyDev > Python Interpreters and configure it.
    If this is not supposed to be a Python project, change the project type on the
    project properties to the project you want (e.g.: Jython project).

    at org.python.pydev.ui.interpreters.AbstractInterpreterManager.getDefaultInterpreter(AbstractInterpreterManager.java:148)

    at org.python.pydev.ui.interpreters.AbstractInterpreterManager.getDefaultInterpreterInfo(AbstractInterpreterManager.java:199)

    at org.python.pydev.ui.interpreters.AbstractInterpreterManager.getDefaultInterpreterInfo(AbstractInterpreterManager.java:1)

    at org.python.pydev.plugin.nature.PythonNature.getProjectInterpreter(PythonNature.java:1097)

     
  • Ferry

    Ferry - 2011-03-14

    Hello,
    See my preferences in the following link:

    Where could I find threading.py within a Jython jar file and how could I put it into the Lib directory?

     
  • Ferry

    Ferry - 2011-03-14
     
  • Fabio Zadrozny

    Fabio Zadrozny - 2011-03-14

    The /Lib folder is not a folder inside your Jython.jar, it's a folder that's usually along the .jar file.

    i.e.:
    /Jython
    /Jython/jython.jar
    /Jython/Lib

    I just took a quick look at grinder and it seems it doesn't ship with it, but they point that you should have it if you want to do anything that uses the Jython llibs (which is your case).

    So, follow their instructions from: http://grinder.sourceforge.net/faq.html#jython-libraries and add the jython you installed (not the default that comes with grinder) + the needed grinder jars.

    Cheers,

    Fabio

     
  • Ferry

    Ferry - 2011-03-15

    Hello,
    After installing Jhython 2.2.1 und using this installation in the Pydev preferences it works.
    Thx for your advice!
    :-) ferry

     
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.