[Tutor] Import error in UNO

Chris Calloway cbc at unc.edu
Wed Feb 6 18:40:28 CET 2008


On Feb 6, 2008, at 5:23 AM, muhamed niyas wrote:

> I can import when i moved to the uno location.
> pls see the messages in the terminal.
>
>
> C:\>cd "Program Files\OpenOffice.org 2.0\program"\
> C:\Program Files\OpenOffice.org 2.0\program>python
> Python 2.3.4 (#53, Feb  2 2006, 01:06:22) [MSC v.1310 32 bit  
> (Intel)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import uno
> >>>


Given this and the behavior before where the import uno did not  
return to the prompt, it sounds like the dependencies the uno module  
has on the OpenOffice libraries. When OpenOffice is in the current  
path, uno seems to be able to find them.

If you look at the windows documentation for uno:

http://udk.openoffice.org/python/python-bridge.html

even the hello world examples have you switch to the Open Office  
program directory.

Later on in the documentation, it explains this (pay close attention  
the third paragraph below):

"Unlike the Java or C++ UNO binding, the python UNO binding is not  
self contained. It requires the C++ UNO binding and additional  
scripting components. These additional components currently live in  
the shared libraries typeconverter.uno, invocation.uno,  
corereflection.uno, introspection.uno, invocadapt.uno, proxyfac.uno,  
pythonloader.uno (on windows typeconverter.uno.dll,...; unix  
typeconverter.uno.so,...).

Often, the components for setting up an interprocess connection are  
also required. These are uuresolver.uno, connector.uno,  
remotebridge.uno, bridgefac.uno shared libraries.

The path environment variables ( LD_LIBRARY_PATH on Unix, PATH on  
Windows) must point to a directory, where the core UNO libraries, the  
above listed components and the pyuno shared library is located. (On  
Unix, there exists two files: libpyuno.so containing the code and a  
pyuno.so which is needed for importing a native python module).  
Additionally, the python module uno.py, unohelper.py and  
pythonloader.py must be located in a directory, which is listed in  
the PYTHONPATH environment variable. "

--
Sincerely,

Chris Calloway
http://www.seacoos.org
office: 332 Chapman Hall cell: (919) 599-3530
mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20080206/e61e1c8d/attachment.htm 


More information about the Tutor mailing list