Message1967
The jython.bat interactive mode can not import the python module which name begin com or org.
Please delete cachedir under JYTHON directory before each test. I find if the module is imported successfully, the import error will not appear again.
I put three different module in the attachment, they are
com.ssc.sstz.const, oeg.ssc.sstz.const, peg.ssc.sstz.const
ATTENTION: Delete cachedir
If you run with jython.bat under JYTHON directory and enter interactive mode run the command below
----------------------------------------
import sys
sys.path.append(r"C:\HShen\workspace\Europa\JythonDemo\src") # change the module path to your uncompress directory
print sys.path
import com.ssc.sstz.const
import org.ssc.sstz.const
import peg.ssc.sstz.const
print com.ssc.sstz.const.CONST
print org.ssc.sstz.const.CONST
print peg.ssc.sstz.const.CONST
-----------------------------------------
Then you will find import com.ssc.sstz.const and org.ssc.sstz.const fail, and peg.ssc.sstz.const success
And I find if I put python module in the front of sys.path, It's OK.
ATTENTION: Delete cachedir
If you run with jython.bat under JYTHON directory and enter interactive mode run the command below
----------------------------------------
import sys
sys.path.insert(0, r"C:\HShen\workspace\Europa\JythonDemo\src") # change the module path to your uncompress directory
print sys.path
import com.ssc.sstz.const
import org.ssc.sstz.const
import peg.ssc.sstz.const
print com.ssc.sstz.const.CONST
print org.ssc.sstz.const.CONST
print peg.ssc.sstz.const.CONST
-----------------------------------------
All the three module are imported successfully.
And I find this problem appear win the jython.bat interactive mode or you run the python script JYTHON HOME directory. |
|
Date |
User |
Action |
Args |
2008-02-20 17:18:04 | admin | link | issue1810514 messages |
2008-02-20 17:18:04 | admin | create | |
|