Re: [Zope-dev] Error by using libraries with an external method

2002-06-24 Thread Juliette Colmant
 
  Leonardo Rochael Almeida <[EMAIL PROTECTED]> a écrit : 

On Fri, 2002-06-21 at 17:25, Juliette Colmant wrote:> > > [...]> > > Error Type: ImportError> > > Error Value: ./test.so: cannot open shared object> > > file: No such file or directory> > --- Leonardo Rochael Almeida <[EMAIL PROTECTED]>> > You probably need to put your library in the> > PYTHONPATH of Zope. The> > usual place is> > /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.> > I've tried to put the module and the librarie I use in> the directory you gave me but I have still the same> error.> Actually, I have a module that use a library. Zope has> no problem about the module. The problem is about the> library...> If you have an other idea?I'm assuming that you mean the *module* is an extension library (i.e. a.so file that is imported by your python code) and the *library* isanother .so that is needed by that module. In this case, the module mustbe in the PYTHONPATH just as I mentioned, but the library must be inyour machine dynamic linker path. Take a look at the ld.so man page("man ld.so") and, if your machine runs Linux, at the file/etc/ld.so.conf and the ldconfig man page ("man ldconfig"). You may needto configure the LD_LIBRARY_PATH environment variable.Cheers, Leops: when replying to help posts, please also reply to the list, not justthe original poster. Actually, it's better if you just reply to thelist, as the original poster will already receive the message.-- Ideas don't stay in some minds very long because they don't likesolitary confinement.
Hy Leo,
I tried what you told me about  the ld.so and ldconfig, but it doesn't work nether...
I have still the same error!
Juliette.
 Yahoo! Mail -- Une adresse @yahoo.fr gratuite et en français !

Re: [Zope-dev] Error by using libraries with an external method

2002-06-24 Thread Leonardo Rochael Almeida


On Fri, 2002-06-21 at 17:25, Juliette Colmant wrote:
> > > [...]
> > > Error Type: ImportError
> > > Error Value: ./test.so: cannot open shared object
> > > file: No such file or directory
> 
>  --- Leonardo Rochael Almeida <[EMAIL PROTECTED]>
> > You probably need to put your library in the
> > PYTHONPATH of Zope. The
> > usual place is
> > /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.
> 
> I've tried to put the module and the librarie I use in
> the directory you gave me but I  have still the same
> error.
> Actually, I have a module that use a library. Zope has
> no problem about the module. The problem is about the
> library...
> If you have an other idea?

I'm assuming that you mean the *module* is an extension library (i.e. a
.so file that is imported by your python code) and the *library* is
another .so that is needed by that module. In this case, the module must
be in the PYTHONPATH just as I mentioned, but the library must be in
your machine dynamic linker path. Take a look at the ld.so man page
("man ld.so") and, if your machine runs Linux, at the file
/etc/ld.so.conf and the ldconfig man page ("man ldconfig"). You may need
to configure the LD_LIBRARY_PATH environment variable.

Cheers, Leo

ps: when replying to help posts, please also reply to the list, not just
the original poster. Actually, it's better if you just reply to the
list, as the original poster will already receive the message.

-- 
Ideas don't stay in some minds very long because they don't like
solitary confinement.



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Error by using libraries with an external method

2002-06-24 Thread Matt Behrens

Dario Lopez-Kästen wrote:

> From: "Leonardo Rochael Almeida" <[EMAIL PROTECTED]


>>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 :-)



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Error by using libraries with an external method

2002-06-23 Thread Dario Lopez-Kästen


From: "Leonardo Rochael Almeida" <[EMAIL PROTECTED]
> 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, [EMAIL PROTECTED]IT Systems & Services
System Developer/System Administrator Chalmers University of Tech.





___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Error by using libraries with an external method

2002-06-21 Thread Leonardo Rochael Almeida

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 /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.



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )