The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

MySQLdb, Python and cpanel

Discussion in 'General Discussion' started by MikeMc, Jul 3, 2004.

  1. MikeMc

    MikeMc Well-Known Member

    Joined:
    May 8, 2002
    Messages:
    161
    Likes Received:
    0
    Trophy Points:
    16
    Hi,
    having on a server both 1.5.2 and 2.2.2 versions of Python (not my fault or bad), maybe cpanel's idea... I find myself unable to import MySQLdb (import MySQLdb) when using python2 (python 2.2.2 version).

    root@xxxx [/var/log]# python2
    Python 2.2.2 (#1, Jan 30 2003, 21:26:22)
    [GCC 2.96 20000731 (Red Hat Linux 7.3 2.96-112)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import MySQLdb
    Traceback (most recent call last):
    File "<stdin>", line 1, in ?
    ImportError: No module named MySQLdb
    >>>

    The import works with the main version 1.5.2 of Python :

    root@xxxx [/var/log]# python
    Python 1.5.2 (#1, Jan 31 2003, 10:58:35) [GCC 2.96 20000731 (Red Hat Linux 7.3 2 on linux-i386
    Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
    >>> import MySQLdb
    >>>


    I would really appreciate your help :
    - Any idea idea why importing MySQLdb does not work with python2 on cpanel servers?
    - Installing MySQL-python-1.0.0.tar.gz for the 2.2.2 version of python is possible? If yes, any specific changes that I should make or follow during the setup of MySQL-python-1.0.0? I want it to get installed only for the version 2.2.2.
    - Any other suggestions are welcome.

    Thanks.
     
Loading...

Share This Page