You are not logged in.

#1 2008-11-11 10:21:08

roadt
Member
Registered: 2007-10-18
Posts: 26

[Problem] mod_python, Error when import mod_python.apache.

$ python
Python 2.6 (r26:66714, Oct 27 2008, 10:50:31)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mod_python.apache
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/site-packages/mod_python/apache.py", line 30, in <module>
    import _apache
ImportError: No module named _apache


> searched _apache.so in the python packages directory  and mod_python package files.
doesn't exists

$ ls /usr/lib/python2.6/site-packages/mod_python/*.so
/usr/lib/python2.6/site-packages/mod_python/_psp.so

maybe it's a bug for mod_python package,
who can help on this?

Offline

#2 2008-11-11 16:10:01

Mashi
Member
Registered: 2007-02-19
Posts: 38

Re: [Problem] mod_python, Error when import mod_python.apache.

I'm pretty sure your problem is that you now have 2 python lib directories, one for 2.5 and one for 2.6. Your interpreter is set to python 2.6, but the python libraries you are trying to import are still in the python2.5 directory (/usr/lib/python2.5 vs /usr/lib/python2.6).

I'm havnig the same issue right now, python2.6 is installed, my interpreter is still python 2.5, but I installed Django and it went into the new directory so the interpreter couldn't find it. Ok, so at some point the interpreter will be 2.6, anyone know if I can just cp all the missing libraries over or if I will have to install them all afresh?

Edit: My python interpreter is now 2.6 and it appears to be finding libraries in the 2.5 directory, so that might invalidate what I said above...

Last edited by Mashi (2008-11-11 18:25:04)

Offline

#3 2008-11-11 17:21:24

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: [Problem] mod_python, Error when import mod_python.apache.

file a bug report.

Offline

#4 2008-11-12 05:51:43

roadt
Member
Registered: 2007-10-18
Posts: 26

Re: [Problem] mod_python, Error when import mod_python.apache.

Mashi wrote:

I'm pretty sure your problem is that you now have 2 python lib directories, one for 2.5 and one for 2.6. Your interpreter is set to python 2.6, but the python libraries you are trying to import are still in the python2.5 directory (/usr/lib/python2.5 vs /usr/lib/python2.6).

I'm havnig the same issue right now, python2.6 is installed, my interpreter is still python 2.5, but I installed Django and it went into the new directory so the interpreter couldn't find it. Ok, so at some point the interpreter will be 2.6, anyone know if I can just cp all the missing libraries over or if I will have to install them all afresh?

Edit: My python interpreter is now 2.6 and it appears to be finding libraries in the 2.5 directory, so that might invalidate what I said above...

I just checked the /usr/lib/python2.5 ,
yes , for many modules   such as     _ldap.


$ python
Python 2.6 (r26:66714, Oct 27 2008, 10:50:31)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import _ldap;
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: libpython2.5.so.1.0: cannot open shared object file: No such file or directory

it's the right reason.

but also, No,
I still can't find the _apache.so under any  /usr/lib/python*

$ find  /usr/lib/python* | grep apache.so | wc -l
0

Thanks for reponse.  i'll fire a bug for this.

Offline

#5 2008-12-16 03:35:18

user317
Member
Registered: 2008-12-15
Posts: 2

Re: [Problem] mod_python, Error when import mod_python.apache.

did you figure out a workaround?  looks like xen has a similar problem.  it installs its python packages into /usr/lib/python, which is not in the sys.path.  If i add that path to PYTHONPATH, i get the same error as you,
ImportError: libpython2.5.so.1.0: cannot open shared object file: No such file or directory

Offline

#6 2008-12-16 03:43:13

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,410
Website

Re: [Problem] mod_python, Error when import mod_python.apache.

I don't remember every seeing a bug report about this.  Did anybody file one?

Offline

#7 2008-12-29 02:54:36

roadt
Member
Registered: 2007-10-18
Posts: 26

Re: [Problem] mod_python, Error when import mod_python.apache.

Allan,  fired one,   Thanks for reminder, and sorry for the late...
http://bugs.archlinux.org/task/12607

Offline

Board footer

Powered by FluxBB