pyuno exception with module install

pyuno exception with module install

Postby jcnorman » Wed Jan 13, 2010 8:52 am

I'm getting the folowlng while installing the report-openoffice module:


Environment Information :
System : Linux-2.6.31-17-generic-i686-with-Ubuntu-9.10-karmic
OS Name : posix
Distributor ID: Ubuntu
Description: Ubuntu 9.10
Release: 9.10
Codename: karmic
Operating System Release : 2.6.31-17-generic
Operating System Version : #54-Ubuntu SMP Thu Dec 10 16:20:31 UTC 2009
Operating System Architecture : 32bit
Operating System Locale : en_US.UTF8
Python Version : 2.6.4
OpenERP-Client Version : 5.0.3
Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):
File "/usr/lib/openerp-server/netsvc.py", line 244, in dispatch
result = LocalService(service_name)(method, *params)
File "/usr/lib/openerp-server/netsvc.py", line 73, in __call__
return getattr(self, method)(*params)
File "/usr/lib/openerp-server/service/web_services.py", line 639, in execute
return self._execute(db, uid, wiz_id, datas, action, context)
File "/usr/lib/openerp-server/service/web_services.py", line 619, in _execute
return wiz.execute(db, uid, self.wiz_datas[wiz_id], action, context)
File "/usr/lib/openerp-server/wizard/__init__.py", line 177, in execute
res = self.execute_cr(cr, uid, data, state, context)
File "/usr/lib/openerp-server/wizard/__init__.py", line 73, in execute_cr
action_res = action(self, cr, uid, data, context)
File "/usr/lib/openerp-server/addons/base/module/wizard/wizard_module_upgrade.py", line 92, in _upgrade_module
db, pool = pooler.restart_pool(cr.dbname, update_module=True)
File "/usr/lib/openerp-server/pooler.py", line 62, in restart_pool
return get_db_and_pool(db_name, force_demo, status, update_module=update_module)
File "/usr/lib/openerp-server/pooler.py", line 40, in get_db_and_pool
addons.load_modules(db, force_demo, status, update_module)
File "/usr/lib/openerp-server/addons/__init__.py", line 728, in load_modules
r = load_module_graph(cr, graph, status, report=report)
File "/usr/lib/openerp-server/addons/__init__.py", line 578, in load_module_graph
register_class(package.name)
File "/usr/lib/openerp-server/addons/__init__.py", line 400, in register_class
imp.load_module(m, *fm)
File "/usr/lib/openerp-server/addons/report_openoffice/__init__.py", line 29, in <module>
import report_openoffice
File "/usr/lib/openerp-server/addons/report_openoffice/report_openoffice.py", line 39, in <module>
from DocumentConverter import DocumentConverter
File "/usr/lib/openerp-server/addons/report_openoffice/DocumentConverter.py", line 16, in <module>
from com.sun.star.beans import PropertyValue
File "/usr/lib/python2.5/site-packages/uno.py", line 278, in _uno_import
RuntimeException = pyuno.getClass( "com.sun.star.uno.RuntimeException" )
RuntimeError: pyuno.getClass: expecting one string argument


The openerp-server script has:
#!/bin/sh
export PYTHONPATH=$PYTHONPATH:/usr/lib/openoffice/program:/usr/lib/openoffice/ure/lib:/usr/lib/openoffice/basis3.1/program
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/openoffice/ure/lib:/usr/lib/openoffice/basis3.1/program

cd /usr/lib/openerp-server
exec /usr/bin/python2.5 ./openerp-server.py $@

Environment is Ubuntu 9.10, OpenERP 5.05 Modules installed using Ubuntu package manager.

I suspect that it may be due to a difference in required modules???
Any suggestions?
jcnorman
 
Posts: 1
Joined: Wed Jan 13, 2010 8:45 am

Re: pyuno exception with module install

Postby Normunds » Wed Jan 13, 2010 5:24 pm

Firstly try if this module (uno) works at all for your particular python version, OOo should be compiled exactly against python version you use for OpenERP.
Execute those export variables, then try in python console import uno module with commands:

Python 2.5.1 (r251:54863, Jun 15 2008, 18:24:56)
[GCC 4.3.0 20080428 (Red Hat 4.3.0-8)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import uno
>>> import pyuno
>>>

if there are no error messages then, should investigate elsewhere.
Normunds
 
Posts: 35
Joined: Tue May 12, 2009 10:34 am

Re: pyuno exception with module install

Postby phu » Thu Apr 08, 2010 11:01 pm

Well actually I got this error too. After spending many hours and trying many times, I can install it successfully. The error is due to different Python versions of the one for launching openerp and Ooo python.
It failed when I use Python2.5 for launching OpenERP server and ln -s /usr/bin/python2.5 to /opt/openoffice.../program/python.bin.
Change all to Python2.6. It works like a charm!
You may try to know which Python version works for you by typing same commands in different Python interpreters:
>>> import uno
>>> import pyuno
>>> pyuno.getClass( "com.sun.star.uno.RuntimeException" )

Which version succeeds in those commands is the one you should use.
phu
 
Posts: 4
Joined: Tue Feb 23, 2010 11:56 pm

Re: pyuno exception with module install

Postby nareshchilukuru » Sun Apr 11, 2010 7:22 am

Hi Normunds,
Iam not having any python knowledge.For docconversion of items I tried to use one python script when I ran that file I get the following error.I know there is mismatch of versions of the modules but I dont know exact process how to resolve the issue.
Please provide me the solution .... thanks in advance

Error code:

docConversionService.py:6: RuntimeWarning: Python C API version mismatch for module pyuno: This Python has API version 1012, module pyuno has version 1013.
import pyuno,uno,gfx,os, re, time, sys, string, urlparse, urllib2, gzip
/opt/openoffice.org/basis3.1/program/uno.py:257: RuntimeWarning: Python C API version mismatch for module gfx: This Python has API version 1012, module gfx has version 1013.
return _g_delegatee( name, *optargs, **kwargs )
Traceback (most recent call last):
File "docConversionService.py", line 6, in ?
import pyuno,uno,gfx,os, re, time, sys, string, urlparse, urllib2, gzip
File "/opt/openoffice.org/basis3.1/program/uno.py", line 257, in _uno_import
return _g_delegatee( name, *optargs, **kwargs )
File "/usr/lib/python2.4/urllib2.py", line 108, in ?
import cookielib
File "/opt/openoffice.org/basis3.1/program/uno.py", line 257, in _uno_import
return _g_delegatee( name, *optargs, **kwargs )
File "/usr/lib/python2.4/cookielib.py", line 28, in ?
import sys, re, urlparse, copy, time, urllib, logging
File "/opt/openoffice.org/basis3.1/program/uno.py", line 257, in _uno_import
return _g_delegatee( name, *optargs, **kwargs )
File "/usr/lib/python2.4/copy.py", line 59, in ?
from org.python.core import PyStringMap
File "/opt/openoffice.org/basis3.1/program/uno.py", line 273, in _uno_import
RuntimeException = pyuno.getClass( "com.sun.star.uno.RuntimeException" )
RuntimeError: pyuno.getClass: expecting one string argument
nareshchilukuru
 
Posts: 1
Joined: Sun Apr 11, 2010 7:18 am

Re: pyuno exception with module install

Postby sraps » Mon Apr 12, 2010 11:45 am

Please pay attention to this warning...
RuntimeWarning: Python C API version mismatch for module gfx: This Python has API version 1012, module gfx has version 1013.


Obviously you have some version mismatch of libraries. Although we are providing free help (read "help") on generic cases, and free support where there seem to be bugs, but we can not provide free support for installation problems specific to your system.

Best regards,
Kaspars
sraps
 
Posts: 403
Joined: Mon May 04, 2009 10:04 pm


Return to Aeroo Reports & OpenOffice.org Reporting Engine

cron
Copyright © 2001 Alistek Ltd., ALL RIGHTS RESERVED