Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

MySQLdb, Python and cpanel

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

  1. MikeMc

    MikeMc Well-Known Member

    May 8, 2002
    Likes Received:
    Trophy Points:
    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.


Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice