Jython Pythonpath question

Discussion in 'Python' started by Mark Fink, Feb 21, 2006.

  1. Mark Fink

    Mark Fink Guest

    Hi there,

    I have a source file FailFixture.py in the folder
    D:\AUT_TEST\workspace\JyFIT\testutil. Now I want to import the file
    with "import testutil.FailFixture". Unfortunately I could not figure
    out how to set this up. I am convinced that
    "D:\AUT_TEST\workspace\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>java -Dpython.home=D:\AUT_TEST\Jython21
    -Dpython.path=D:\AUT_TEST\workspace\JyFIT -classpath
    D:\AUT_TEST\Jython21\jython.jar;D:\AUT_TEST\JavaLib\log4j-1.2.13.jar;D:\AUT_TEST\workspace\JyFIT
    org.python.util.jython

    Jython 2.1 on java1.5.0_06 (JIT: null)
    Type "copyright", "credits" or "license" for more information.
    >>> import testutil.FailFixture

    Traceback (innermost last):
    File "<console>", line 1, in ?
    ImportError: No module named FailFixture
    >>> ^Z
    Mark Fink, Feb 21, 2006
    #1
    1. Advertising

  2. Mark Fink

    Kent Johnson Guest

    Mark Fink wrote:
    > Hi there,
    >
    > I have a source file FailFixture.py in the folder
    > D:\AUT_TEST\workspace\JyFIT\testutil. Now I want to import the file
    > with "import testutil.FailFixture". Unfortunately I could not figure
    > out how to set this up. I am convinced that
    > "D:\AUT_TEST\workspace\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?


    Do you have a file D:\AUT_TEST\workspace\JyFIT\testutil\__init__.py ?

    Kent
    Kent Johnson, Feb 21, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Harald Kirsch

    jython and PYTHONPATH

    Harald Kirsch, Jun 28, 2003, in forum: Python
    Replies:
    1
    Views:
    1,201
    Ype Kingma
    Jun 30, 2003
  2. David McNab
    Replies:
    0
    Views:
    452
    David McNab
    Apr 9, 2004
  3. Divya Prakash
    Replies:
    0
    Views:
    425
    Divya Prakash
    Dec 19, 2006
  4. Pinegar, Kent T

    FW: [Jython-users] Jython Licensing Question

    Pinegar, Kent T, Jul 24, 2008, in forum: Python
    Replies:
    0
    Views:
    342
    Pinegar, Kent T
    Jul 24, 2008
  5. Tim Hanson

    newbie question about PYTHONPATH

    Tim Hanson, Feb 15, 2011, in forum: Python
    Replies:
    3
    Views:
    531
    Westley Martínez
    Feb 19, 2011
Loading...

Share This Page