473,395 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

PyUNO with different Python

Hi!
maybe somebody can give me an hint to my problem setting up PyUNO on my
Mac to work with my Python not the Python delivered with OpenOffice.
As said in installation instructions I've set
OPENOFFICE_PATH="/usr/lib/openoffice/program"
export PYTHONPATH="$OPENOFFICE_PATH"
export LD_LIBRARY_PATH="$OPENOFFICE_PATH"
according to my environment.

importing uno gives me this error:
import uno

Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/Applications/OpenOffice.org
2.0.app/Contents/openoffice.org2.0/program/uno.py", line 37, in ?
import pyuno
ImportError: No module named pyuno

which means python finds uno but not pyuno (pyuno.dylib).

Any hints?
Regards, Katja
Feb 22 '06 #1
7 3795
� wrote:
Hi! maybe somebody can give me an hint to my problem setting up PyUNO
on my Mac to work with my Python not the Python delivered with
OpenOffice. As said in installation instructions I've set
OPENOFFICE_PATH="/usr/lib/openoffice/program" export
PYTHONPATH="$OPENOFFICE_PATH" export
LD_LIBRARY_PATH="$OPENOFFICE_PATH" according to my environment.

importing uno gives me this error:
import uno
Traceback (most recent call last): File "<stdin>", line 1, in ? File
"/Applications/OpenOffice.org
2.0.app/Contents/openoffice.org2.0/program/uno.py", line 37, in ?
import pyuno ImportError: No module named pyuno

which means python finds uno but not pyuno (pyuno.dylib).


Do you want to use system python inside OOo (inside a macro, or...), or
system python outside OOo?

For the first, follow this:
http://udk.openoffice.org/python/pyt...html#replacing

for the second:
http://udk.openoffice.org/python/pyt...dge.html#modes
Any hints? Regards, Katja


Michele
Feb 22 '06 #2
Hi!

The second way don't run:

Traceback (most recent call last):
File "C:\Program Files\OpenOffice.org 2.0\program\hello_world.py", line 1,
in?
import uno
File "C:\Program Files\OpenOffice.org 2.0\program\uno.py", line 37, in ?
import pyuno
ImportError: Module use of python23.dll conflicts with this version of
Python.

@+

MCI
Feb 22 '06 #3
Michele Petrazzo schrieb:
� wrote:
Hi! maybe somebody can give me an hint to my problem setting up PyUNO
on my Mac to work with my Python not the Python delivered with
OpenOffice. As said in installation instructions I've set
OPENOFFICE_PATH="/usr/lib/openoffice/program" export
PYTHONPATH="$OPENOFFICE_PATH" export
LD_LIBRARY_PATH="$OPENOFFICE_PATH" according to my environment.

importing uno gives me this error:

>import uno


Traceback (most recent call last): File "<stdin>", line 1, in ? File
"/Applications/OpenOffice.org
2.0.app/Contents/openoffice.org2.0/program/uno.py", line 37, in ?
import pyuno ImportError: No module named pyuno

which means python finds uno but not pyuno (pyuno.dylib).

Do you want to use system python inside OOo (inside a macro, or...), or
system python outside OOo?

For the first, follow this:
http://udk.openoffice.org/python/pyt...html#replacing

for the second:
http://udk.openoffice.org/python/pyt...dge.html#modes

Any hints? Regards, Katja

Michele


Thanks. What I have in mind is to write a Python script to generate PDFs from a set of ODTs.
This script has to run in Zope which brings its own Python.
My problem is the setup of PyUNO with this Python which is not the OO included one.
Hope to find a Mac user who made/solved similar experience...
Regards, Katja
Feb 22 '06 #4
Méta-MCI schrieb:
The second way don't run:

Traceback (most recent call last):
File "C:\Program Files\OpenOffice.org 2.0\program\hello_world.py", line 1,
in?
import uno
File "C:\Program Files\OpenOffice.org 2.0\program\uno.py", line 37, in ?
import pyuno
ImportError: Module use of python23.dll conflicts with this version of
Python.


Sounds like you might want to switch back to Python 2.3 ...

Stefan
Feb 23 '06 #5
Stefan Behnel wrote:
M�ta-MCI schrieb:
The second way don't run:

Traceback (most recent call last): File "C:\Program
Files\OpenOffice.org 2.0\program\hello_world.py", line 1, in?
import uno File "C:\Program Files\OpenOffice.org
2.0\program\uno.py", line 37, in ? import pyuno ImportError: Module
use of python23.dll conflicts with this version of Python.
Sounds like you might want to switch back to Python 2.3 ...


Yes and no.
I have both 2.3 and 2.4 on my debian system and with both, the program
at: http://udk.openoffice.org/python/samples/ooextract.py

work well with a modify:
before the first line "import uno", add:

import sys
sys.path.append("/opt/openoffice.org2.0/program/")

Now, save the program, move it where you want, and go:

michele:~$ python2.3 tmp/ooextract.py --pdf test.odt
michele:~$ python2.4 tmp/ooextract.py --pdf test.odt

Both create the test.pdf file!

P.s. Before execute the script, execute OOo:
soffice "-accept=socket,host=localhost,port=2002;urp;"
Stefan


Michele
Feb 23 '06 #6
Katja Suess wrote:
Thanks. What I have in mind is to write a Python script to generate
PDFs from a set of ODTs.
Pay attention that you have a OOo program running somewhere that accept
the connection from your zope server (I don't think that you have a X
server running on it.)
This script has to run in Zope which brings its own Python. My
problem is the setup of PyUNO with this Python which is not the OO
included one.
Try with the little modify that I wrote and the other post and let us know.
Hope to find a Mac user who made/solved similar experience...
Regards, Katja


Michele
Feb 23 '06 #7
hmmmm...

I can run OK "hello_world.py". But only with Python-core-2.3

Python 2.4 don't run (conflict-version, or windows error).
And, it's not possible to install extensions (like PyWin) to Python-core-2.3
(this destroy the same extensions in my "normal" Python 2.4)

I had let down these aspects of OOo.

*sorry for my bad english*

MCI

Feb 25 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Thomas Guettler | last post by:
Hi! The introduction on http://udk.openoffice.org/python/python-bridge.html is very good. Nice to see, that python is integrated into OpenOffice1.1. Has somone written a script which...
4
by: Thomas Guettler | last post by:
Hi! This script will convert files to PDF with OpenOffice. Other formats (html, doc ...) should be possible, too. Have a nice day, thomas # OpenOffice1.1 comes with its own python...
1
by: John Hunter | last post by:
Does anyone have any example scripts using the OpenOffince python-bridge module pyuno to load xls, extract the data, and/or save to another format such as xsc or csv. Thanks, JDH
137
by: Philippe C. Martin | last post by:
I apologize in advance for launching this post but I might get enlightment somehow (PS: I am _very_ agnostic ;-). - 1) I do not consider my intelligence/education above average - 2) I am very...
1
by: Max M | last post by:
I would like to install several copies of Python 2.4.2 on my machine, but it doesn't seem to be possible. If I allready has a version installed, the installer only gives the options to: -...
0
by: Sells, Fred | last post by:
I'm using windows xp and OpenOffice 2.0 and doing my first project with pyuno. I've got the basics to work,. An example I googled at...
0
by: Sells, Fred | last post by:
I can use java to output a PDF file using uno, but when I try to do it in python, I get an IO Exception with no added information. The relevant code snippet follows: from com.sun.star.beans...
4
by: jayro | last post by:
Hi people, I need to generate ODT documents from Python so I wonder if there is any module capable to do so. What I need is to generate an ODT document containing images and text frames with text...
2
by: DarkBlue | last post by:
Hello Python 2.5.1 Qt 4.4.0 PyQt 4.4.2 OO 2.4.1 Firebird 2.1 I want to store an openoffice writer object into a blob field using the pyuno bridge. I read about the possibility of using...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.