Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ZMySQLDA can't import _mysql module, but python can [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
nyk
Guru
Guru


Joined: 28 Aug 2004
Posts: 527
Location: Bern (Switzerland)

PostPosted: Thu Feb 16, 2006 7:57 pm    Post subject: ZMySQLDA can't import _mysql module, but python can [SOLVED] Reply with quote

I emerged zope and zmysqlda, but the ZMySQLDA product is "broken". This is the traceback:
Code:

Traceback (most recent call last):
  File "/usr/lib/zope-2.8.4/lib/python/OFS/Application.py", line 695, in import_product
    product=__import__(pname, global_dict, global_dict, silly)
  File "/var/lib/zope/zope/Products/ZMySQLDA/__init__.py", line 91, in ?
    import DA
  File "/var/lib/zope/zope/Products/ZMySQLDA/DA.py", line 92, in ?
    from db import DB
  File "/var/lib/zope/zope/Products/ZMySQLDA/db.py", line 89, in ?
    import _mysql
ImportError: No module named _mysql

From the command line I CAN import _mysql in python2.4, but not in python2.3.
I tried re-emerging mysql-python and then zope and zmysqlda, but this didn't help. What else could I try?

EDIT: Got it to work now by changing zopectl and runzope to use python 2.4.
Somehow, these changes should also be made in portage, as the current package is not working!
But I don't have lots of experience with creating ebuilds, and most of all I don't know who decides if it's okay to use python 2.4 for zope by default.

EDIT2: Now I changed it back to 2.3 in zopectl and 2.4 in runzope. This way the zmysqlda works and I don't get the DeprecationWarnings (whrandom) on startup anymore! It's really using 2.3 for the root owned "zdrun.py" process, which is like "init", I guess... Then it spawns 2.4 python threads. Which should be okay...?


Last edited by nyk on Tue Mar 28, 2006 5:43 pm; edited 1 time in total
Back to top
View user's profile Send private message
pancapangrawit
n00b
n00b


Joined: 10 Jan 2005
Posts: 8
Location: Graz (Austria)

PostPosted: Tue Feb 21, 2006 12:20 am    Post subject: Reply with quote

But can you run plone with python 2.4?
Back to top
View user's profile Send private message
__hermes__
n00b
n00b


Joined: 19 Dec 2004
Posts: 8

PostPosted: Wed Feb 22, 2006 10:52 am    Post subject: How do u do Reply with quote

I got exactly the same PB
How do u do that switching op ?

Thx
Back to top
View user's profile Send private message
nyk
Guru
Guru


Joined: 28 Aug 2004
Posts: 527
Location: Bern (Switzerland)

PostPosted: Thu Feb 23, 2006 8:08 am    Post subject: Reply with quote

Don't know about plone, I am using ZMS and it works with zmysqlda!

In the file /var/lib/zope/zope/bin/runzope, change the line
PYTHON="/usr/bin/python2.3"
to
PYTHON="/usr/bin/python2.4"

PS: Maybe you path is different, if you did't name you zope "zope". Then it would be /var/lib/zope/something_else/bin/runzope I guess....
But I always look it up in the zope control panel ("INSTANCE_HOME") anyway.
Back to top
View user's profile Send private message
__hermes__
n00b
n00b


Joined: 19 Dec 2004
Posts: 8

PostPosted: Thu Feb 23, 2006 10:15 am    Post subject: Thx Reply with quote

Thx it works !
I'm happy :lol:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum