You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by Erik Holstad <er...@gmail.com> on 2009/11/20 18:32:48 UTC

Re: Error running contrib tests

Hey!
I have been working with the zkpython module for that last couple of weeks.
After the initial problem with


ImportError: libzookeeper_mt.so.2: cannot open shared object file: No such
file or directory

I just added LD_LIBRARY_PATH=/usr/local/lib to the .bashrc file and
everything worked fine. For pydev
I had to add it as an Environment variable, to make it work.

But when moving away from raw python to to using it in a fcgi context I was
not able to get it to work under any
circumstances.

We were running this using python 2.5, which seemed to be one of the
problems, the other one that I've found
was the build script in zookeeper_home/src/contrib/
zkpython. when running sudo ant install everyhing works fine
but when trying to import it in python 2.6 I still got the same error.

Changing the setup.py file to point to the correct libraries and running
sudo python setup.py install everything works
fine and no more errors.

Just wanted to share this with the community since I've spend quite some
time trying to ge this to work.

Regards Erik

Re: Error running contrib tests

Posted by Erik Holstad <er...@gmail.com>.
Yeah, i like that approach better.

Will do.

Erik

Re: Error running contrib tests

Posted by Patrick Hunt <ph...@apache.org>.
Yes, that was my thinking as well - something like configure does 
(autotools) where it will tell you some details after calling it 
(although in this case the output is after install).

Sounds good!

Patrick

Mahadev Konar wrote:
> I would suggest adding it to the readme no? Modifying /etc files with sudo
> access could be dangerous and we might mess up somethings. Would it be good
> to add a print statement in the setup saying that you might need to do edit
> /etc/ld.so.conf and run /sbin/ldconfig in case of Fedora?
> So the users would see the statement after running setup.py?
> 
> Thanks
> mahadev
> 
> 
> On 11/23/09 6:25 PM, "Erik Holstad" <er...@gmail.com> wrote:
> 
>> Have been messing around to try to get it included in the setup.py script.
>> But not sure
>> if it is good to have it there since writing to /usr/ld.so.conf and
>> reloading the /sbin/ldconfig
>> requires sudo status. But on the other hand that is needed to install from
>> the beginning.
>>
>> I could add something like this to the end of the setup file
>>
>> print "Setting up dependencies"
>> try:
>>   f = open("/etc/ld.so.conf", 'r+')
>>   content = f.read()
>>   path = "/usr/local/lib"
>>   if content.find(path) == -1:
>>     f.write(path)
>>
>> except Exception, e:
>>   pass
>>
>> import subprocess
>> subprocess.call(['sudo', '/sbin/ldconfig'])
>>
>> Erik
> 

Re: Error running contrib tests

Posted by Mahadev Konar <ma...@yahoo-inc.com>.
I would suggest adding it to the readme no? Modifying /etc files with sudo
access could be dangerous and we might mess up somethings. Would it be good
to add a print statement in the setup saying that you might need to do edit
/etc/ld.so.conf and run /sbin/ldconfig in case of Fedora?
So the users would see the statement after running setup.py?

Thanks
mahadev


On 11/23/09 6:25 PM, "Erik Holstad" <er...@gmail.com> wrote:

> Have been messing around to try to get it included in the setup.py script.
> But not sure
> if it is good to have it there since writing to /usr/ld.so.conf and
> reloading the /sbin/ldconfig
> requires sudo status. But on the other hand that is needed to install from
> the beginning.
> 
> I could add something like this to the end of the setup file
> 
> print "Setting up dependencies"
> try:
>   f = open("/etc/ld.so.conf", 'r+')
>   content = f.read()
>   path = "/usr/local/lib"
>   if content.find(path) == -1:
>     f.write(path)
> 
> except Exception, e:
>   pass
> 
> import subprocess
> subprocess.call(['sudo', '/sbin/ldconfig'])
> 
> Erik


Re: Error running contrib tests

Posted by Erik Holstad <er...@gmail.com>.
Have been messing around to try to get it included in the setup.py script.
But not sure
if it is good to have it there since writing to /usr/ld.so.conf and
reloading the /sbin/ldconfig
requires sudo status. But on the other hand that is needed to install from
the beginning.

I could add something like this to the end of the setup file

print "Setting up dependencies"
try:
  f = open("/etc/ld.so.conf", 'r+')
  content = f.read()
  path = "/usr/local/lib"
  if content.find(path) == -1:
    f.write(path)

except Exception, e:
  pass

import subprocess
subprocess.call(['sudo', '/sbin/ldconfig'])

Erik

Re: Error running contrib tests

Posted by Patrick Hunt <ph...@apache.org>.
Perhaps the install script for zkpython could check for this and warn 
the user?

Patrick

Mahadev Konar wrote:
> Hi Erik,
>  It would be good to have this info in the README/INSTALL of python
> bindings. It would be great if you can file a jira (and also upload a patch
> :)) for it.
> 
> Thanks
> mahadev
> 
> 
> On 11/23/09 4:12 PM, "Erik Holstad" <er...@gmail.com> wrote:
> 
>> Sorry that it took so long, but I ran into trouble when trying out trunk
>> instead of 3.2.1.
>> It has nothing to do with the zookeeper code, I think, but more with my
>> environment.
>> After switching to trunk, I got back the original error and have been
>> struggling with it
>> since.
>> I'm running on Fedora9.
>> So, to make sure that it works the line "/usr/local/lib/" needs to be in the
>> /etc/ld.so.conf.
>> If it is but it is still not working you have to run /sbin/ldconfig.
>>
>> What I previous wrote about the different versions of Python, doesn't seem
>> to apply
>> any more, works fine for python2,5.
>>
>> On my laptop where I run Ubuntu9.4 I don't have this problem.
>>
>> Regards Erik
> 

Re: Error running contrib tests

Posted by Mahadev Konar <ma...@yahoo-inc.com>.
Hi Erik,
 It would be good to have this info in the README/INSTALL of python
bindings. It would be great if you can file a jira (and also upload a patch
:)) for it.

Thanks
mahadev


On 11/23/09 4:12 PM, "Erik Holstad" <er...@gmail.com> wrote:

> Sorry that it took so long, but I ran into trouble when trying out trunk
> instead of 3.2.1.
> It has nothing to do with the zookeeper code, I think, but more with my
> environment.
> After switching to trunk, I got back the original error and have been
> struggling with it
> since.
> I'm running on Fedora9.
> So, to make sure that it works the line "/usr/local/lib/" needs to be in the
> /etc/ld.so.conf.
> If it is but it is still not working you have to run /sbin/ldconfig.
> 
> What I previous wrote about the different versions of Python, doesn't seem
> to apply
> any more, works fine for python2,5.
> 
> On my laptop where I run Ubuntu9.4 I don't have this problem.
> 
> Regards Erik


Re: Error running contrib tests

Posted by Erik Holstad <er...@gmail.com>.
Sorry that it took so long, but I ran into trouble when trying out trunk
instead of 3.2.1.
It has nothing to do with the zookeeper code, I think, but more with my
environment.
After switching to trunk, I got back the original error and have been
struggling with it
since.
I'm running on Fedora9.
So, to make sure that it works the line "/usr/local/lib/" needs to be in the
/etc/ld.so.conf.
If it is but it is still not working you have to run /sbin/ldconfig.

What I previous wrote about the different versions of Python, doesn't seem
to apply
any more, works fine for python2,5.

On my laptop where I run Ubuntu9.4 I don't have this problem.

Regards Erik

Re: Error running contrib tests

Posted by Erik Holstad <er...@gmail.com>.
Yes, this was on 3.2.1.
Will give it a go and let you know in a little bit.

Erik

Re: Error running contrib tests

Posted by Patrick Hunt <ph...@apache.org>.
What version of ZooKeeper is this? If it's 3.2.1 take a look at this:

binding fixes in 3.2.2
https://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&&pid=12310801&component=12312860&fixfor=12314335&resolution=1&sorter/field=priority&sorter/order=DESC

You might give the 3.2 branch (in svn) a try asap.

Feel free to enter JIRAs if you notice issues, we'll be happy to address 
them.

Patrick

Erik Holstad wrote:
> Hey!
> I have been working with the zkpython module for that last couple of weeks.
> After the initial problem with
> 
> 
> ImportError: libzookeeper_mt.so.2: cannot open shared object file: No such
> file or directory
> 
> I just added LD_LIBRARY_PATH=/usr/local/lib to the .bashrc file and
> everything worked fine. For pydev
> I had to add it as an Environment variable, to make it work.
> 
> But when moving away from raw python to to using it in a fcgi context I was
> not able to get it to work under any
> circumstances.
> 
> We were running this using python 2.5, which seemed to be one of the
> problems, the other one that I've found
> was the build script in zookeeper_home/src/contrib/
> zkpython. when running sudo ant install everyhing works fine
> but when trying to import it in python 2.6 I still got the same error.
> 
> Changing the setup.py file to point to the correct libraries and running
> sudo python setup.py install everything works
> fine and no more errors.
> 
> Just wanted to share this with the community since I've spend quite some
> time trying to ge this to work.
> 
> Regards Erik
>