473,624 Members | 2,223 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="$OP ENOFFICE_PATH"
export LD_LIBRARY_PATH ="$OPENOFFICE_P ATH"
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 3801
� 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="$OP ENOFFICE_PATH" export
LD_LIBRARY_PATH ="$OPENOFFICE_P ATH" 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\OpenOffic e.org 2.0\program\hel lo_world.py", line 1,
in?
import uno
File "C:\Program Files\OpenOffic e.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_PA TH="/usr/lib/openoffice/program" export
PYTHONPATH="$ OPENOFFICE_PATH " export
LD_LIBRARY_PA TH="$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\OpenOffic e.org 2.0\program\hel lo_world.py", line 1,
in?
import uno
File "C:\Program Files\OpenOffic e.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\OpenOffic e.org 2.0\program\hel lo_world.py", line 1, in?
import uno File "C:\Program Files\OpenOffic e.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,h ost=localhost,p ort=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
2331
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 converts .swc files to .ps or .pdf?
4
3425
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 interpreter.
1
1710
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
7051
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 pragmatic - 3) I usually move forward when I get the gut feeling I am correct - 4) Most likely because of 1), I usually do not manage to fully explain 3) when it comes true. - 5) I have developed for many years (>18) in many different environments,...
1
2087
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: - change python 2.4.2 - repair python 2.4.2 - remove python 2.4.2
0
1023
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 http://blogs.nuxeo.com/sections/aggregators/openoffice_org/blogaggregator_vi ew?b_start:int=0 imported an ootools module. When I try to import it, it does not exist, Does anyone know where this exists, or why I cannot import it.
0
1278
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 import PropertyValue PDF = PropertyValue( "FilterName" , 0 , "writer_pdf_Export", 0 ) doc2.storeAsURL("file:///C:/alleclipse/OpenOffice/test2.pdf", (PDF,) ) if I don't specify any properties, it writes an "odt" file just fine, but when I...
4
6157
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 within. I didn't want to do all the files that form an ODT doc "by hand"... Can anyone help me?
2
1610
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 streams ,
0
8238
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8174
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8680
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8624
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8336
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7164
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2607
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1786
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.