Error by using libraries with an external method
Hello, I have a problem using libraries with Zope. I have a C++ program. I made some libraries to be able to call it with Python. When I use just Python it works. But when I call my Python script with a Zope External method i doesn't work. The error message I get is : Zope Error Zope has encountered an error while publishing this resource. Error Type: ImportError Error Value: ./test.so: cannot open shared object file: No such file or directory If someone can help me? Thanks ___________________________________________________________ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com
On Fri, 2002-06-21 at 11:37, Juliette Colmant wrote:
Hello, I have a problem using libraries with Zope. I have a C++ program. I made some libraries to be able to call it with Python. When I use just Python it works. But when I call my Python script with a Zope External method i doesn't work. The error message I get is :
Zope Error
Zope has encountered an error while publishing this resource.
Error Type: ImportError Error Value: ./test.so: cannot open shared object file: No such file or directory
You probably need to put your library in the PYTHONPATH of Zope. The usual place is <zope-root>/lib/python2.1/site-packages Putting it in the Extesions directory, so that it can be imported by external methods, doesn't seem to work, even if you put Extensions in the PYTHONPATH, at least in my experience. -- Ideas don't stay in some minds very long because they don't like solitary confinement.
From: "Leonardo Rochael Almeida" <leo@hiper.com.br
Putting it in the Extesions directory, so that it can be imported by external methods, doesn't seem to work, even if you put Extensions in the PYTHONPATH, at least in my experience.
hm... Putting it in the Extensions directory has worked for me using Zope 2.4.3 (I don't like to mess with the PYTHONPATHG in the Python Install)... Has this changed in later zopes? /dario - -------------------------------------------------------------------- Dario Lopez-Kästen, dario@ita.chalmers.se IT Systems & Services System Developer/System Administrator Chalmers University of Tech.
Dario Lopez-Kästen wrote:
From: "Leonardo Rochael Almeida" <leo@hiper.com.br
Putting it in the Extesions directory, so that it can be imported by external methods, doesn't seem to work, even if you put Extensions in the PYTHONPATH, at least in my experience.
hm... Putting it in the Extensions directory has worked for me using Zope 2.4.3 (I don't like to mess with the PYTHONPATHG in the Python Install)... Has this changed in later zopes?
What's wrong with twiddling PYTHONPATH? My instance home has a 'Packages' directory, where I have stuff like _ldapmodule.so (for ZLDAP), imaging.so, and the PIL and ldap packages. My start script looks like this: ---- #!/bin/sh PYTHON_VER=2.1.3 ZOPE_VER=2.5.1 INSTANCE_HOME=/zope PYTHONPATH=$INSTANCE_HOME/Packages export INSTANCE_HOME PYTHONPATH STUPID_LOG_FILE=$INSTANCE_HOME/var/log/zlog_`date +%Y%m%d`.log STUPID_LOG_SEVERITY=-200 export STUPID_LOG_FILE STUPID_LOG_SEVERITY echo `date` starting >> $INSTANCE_HOME/var/log/start_`date +%Y%m%d`.log exec $INSTANCE_HOME/Python-$PYTHON_VER/bin/python2.1 \ $INSTANCE_HOME/Zope-$ZOPE_VER/z2.py \ -F $INSTANCE_HOME/var/FastCGI.soc -m 8099 -p - "$@" \ >> $INSTANCE_HOME/var/log/start_`date +%Y%m%d`.log 2>&1 ---- All in all, it works pretty well. No need to sweat messing with PYTHONPATH. All instance homes should do this, and have a Packages directory :-)
participants (4)
-
Dario Lopez-Kästen -
Juliette Colmant -
Leonardo Rochael Almeida -
Matt Behrens