Jython Pythonpath question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark Fink

    #1

    Jython Pythonpath question

    Hi there,

    I have a source file FailFixture.py in the folder
    D:\AUT_TEST\wor kspace\JyFIT\te stutil. Now I want to import the file
    with "import testutil.FailFi xture". Unfortunately I could not figure
    out how to set this up. I am convinced that
    "D:\AUT_TEST\wo rkspace\JyFIT" should be included in the pythonpath but
    it does not work. Nor does it work to include this path in the java
    classpath. Any idea whats wrong?

    I experiented a little at the Jython prompt:

    D:\AUT_TEST>jav a -Dpython.home=D: \AUT_TEST\Jytho n21
    -Dpython.path=D: \AUT_TEST\works pace\JyFIT -classpath
    D:\AUT_TEST\Jyt hon21\jython.ja r;D:\AUT_TEST\J avaLib\log4j-1.2.13.jar;D:\A UT_TEST\workspa ce\JyFIT
    org.python.util .jython

    Jython 2.1 on java1.5.0_06 (JIT: null)
    Type "copyright" , "credits" or "license" for more information.[color=blue][color=green][color=darkred]
    >>> import testutil.FailFi xture[/color][/color][/color]
    Traceback (innermost last):
    File "<console>" , line 1, in ?
    ImportError: No module named FailFixture[color=blue][color=green][color=darkred]
    >>> ^Z[/color][/color][/color]

  • Kent Johnson

    #2
    Re: Jython Pythonpath question

    Mark Fink wrote:[color=blue]
    > Hi there,
    >
    > I have a source file FailFixture.py in the folder
    > D:\AUT_TEST\wor kspace\JyFIT\te stutil. Now I want to import the file
    > with "import testutil.FailFi xture". Unfortunately I could not figure
    > out how to set this up. I am convinced that
    > "D:\AUT_TEST\wo rkspace\JyFIT" should be included in the pythonpath but
    > it does not work. Nor does it work to include this path in the java
    > classpath. Any idea whats wrong?[/color]

    Do you have a file D:\AUT_TEST\wor kspace\JyFIT\te stutil\__init__ .py ?

    Kent

    Comment

    Working...