Search Mailing List Archives

Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-discussion] Setting sys.path in Protege Script Tab using Python

Jonathan Carter jonathan.carter at
Wed Oct 22 05:18:58 PDT 2008

I've been having a lot of trouble with setting the classpath /  
pythonpath in the Script Tab - but only on Windows XP / 2003 Server.

I want to import some of the Protege Standard Extension classes in my  
Python script and have used the documented approach following the  
Script Tab wiki and the standard Python approach for dynamically  
adding to the class path, as follows:

import sys

This works very nicely on Mac OS/X and then I can import classes from  
that Jar.

However, when I ran the same script on Windows, it fails to set the  
class/python path and the imports fail. I've tried setting the  
python.path property in the Lax properties in Protege which has the  
same effect as the sys.path.append - the path is defined but does not  
seem to be picked up by the Jython environment.
The only way I could get it to import this Jar was to explicitly add  
it to the class.path property in the Lax properties. However, this  
messed up several of the tabs and can't be used.
I've tried all kinds of variations of defining the path to take  
account of Windows' quirks but to no avail.

Has anyone managed to get the sys.path.append() to work on Windows?
It seems like it just isn't updating the classpath as it should.
 From the source code, it looks like an issue with the underlying  
Jython implementation rather than the tab itself unless I'm missing  



Jonathan Carter - Head of Technical Architecture
Enterprise Architecture Solutions Ltd

Assess your EA maturity at:

W O R L D    C L A S S    A R C H I T E C T U R E

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the protege-discussion mailing list