Re: PyUNO with different Python

2006-02-25 Thread M�ta-MCI
h...

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





-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PyUNO with different Python

2006-02-23 Thread Michele Petrazzo
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
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PyUNO with different Python

2006-02-23 Thread Michele Petrazzo
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
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: PyUNO with different Python

2006-02-22 Thread Stefan Behnel
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
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PyUNO with different Python

2006-02-22 Thread Katja Suess
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 "", 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/python-bridge.html#replacing
> 
> for the second:
> http://udk.openoffice.org/python/python-bridge.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
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: PyUNO with different Python

2006-02-22 Thread M�ta-MCI
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


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PyUNO with different Python

2006-02-22 Thread Michele Petrazzo
� 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 "", 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/python-bridge.html#replacing

for the second:
http://udk.openoffice.org/python/python-bridge.html#modes

> Any hints? Regards, Katja

Michele
-- 
http://mail.python.org/mailman/listinfo/python-list