Issue with MySQLdb wrapper

Discussion in 'Python' started by Gerard M, May 16, 2007.

  1. Gerard M

    Gerard M Guest

    Hi guys I have a big problem with this wrapper im using Ubuntu 7.04
    and I want to install python-MySQLdb, I used synaptics and it is
    installed, but when I try to do
    >>> import MySQLdb

    and I get this error:

    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "MySQLdb/__init__.py", line 19, in <module>
    import _mysql
    ImportError: No module named _mysql

    so I tried to download it from the site and install it from the .tar
    file but I failed because when I run

    #~/Desktop/MySQL-python-1.2.2$ python setup.py install

    I get this output:

    This script requires setuptools version 0.6c5 to run (even to display
    help). I will attempt to download it for you (from
    http://cheeseshop.python.org/packages/2.5/s/setuptools/), but
    you may need to enable firewall access for this script first.
    I will start the download in 15 seconds.

    (Note: if this machine does not have network access, please obtain the
    file

    http://cheeseshop.python.org/packages/2.5/s/setuptools/setuptools-0.6c5-py2.5.egg

    and place it in this directory before rerunning this script.)
    ---------------------------------------------------------------------------
    Downloading http://cheeseshop.python.org/packages/2.5/s/setuptools/setuptools-0.6c5-py2.5.egg
    Traceback (most recent call last):
    File "setup.py", line 5, in <module>
    import ez_setup; ez_setup.use_setuptools()
    File "/home/gerardo/Desktop/MySQL-python-1.2.2/ez_setup.py", line
    85, in use_setuptools
    import setuptools; setuptools.bootstrap_install_from = egg
    zipimport.ZipImportError: can't decompress data; zlib not available

    I dont know whats that zlib, I installed some libraries with zlib
    using synaptics, but still no luck :(, thanks for your help
     
    Gerard M, May 16, 2007
    #1
    1. Advertising

  2. Gerard M

    Guest

    On May 15, 7:22 pm, Gerard M <> wrote:
    > Hi guys I have a big problem with this wrapper im using Ubuntu 7.04
    > and I want to install python-MySQLdb, I used synaptics and it is
    > installed, but when I try to do>>> import MySQLdb
    >
    > and I get this error:
    >
    > Traceback (most recent call last):
    > File "<stdin>", line 1, in <module>
    > File "MySQLdb/__init__.py", line 19, in <module>
    > import _mysql
    > ImportError: No module named _mysql


    Looks like the install of MySQLdb is botched up. You might try and use
    the Ubuntu package management tool to check your installation for
    correctness. If that tells you everything is ok and it's still busted,
    you might try to uninstall, then reinstall MySQLdb.

    If that still doesn't work, you probably should ask about this on one
    of the Ubuntu forums.

    > so I tried to download it from the site and install it from the .tar
    > file but I failed because when I run
    >
    > #~/Desktop/MySQL-python-1.2.2$ python setup.py install
    >
    > [snip]


    In general, my guess is that, unless you have a good reason not to,
    you should probably not install fairly standard python packages by-
    hand like that on Ubuntu. There should be an Ubuntu package for what
    you need, and if there is, you should stick with that. If it fails,
    the Ubuntu folks will want to know about it.

    ---John
     
    , May 16, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alan Little

    can't import MySQldb on OS X

    Alan Little, Jun 25, 2003, in forum: Python
    Replies:
    0
    Views:
    845
    Alan Little
    Jun 25, 2003
  2. Skip Montanaro

    Re: Problem with MySQLdb on Mac OS X...

    Skip Montanaro, Jul 12, 2003, in forum: Python
    Replies:
    5
    Views:
    392
    Michael S. Jessop
    Jul 16, 2003
  3. fedor

    mysqldb issue

    fedor, Mar 10, 2005, in forum: Python
    Replies:
    4
    Views:
    665
    Dennis Lee Bieber
    Mar 12, 2005
  4. Kurian Thayil

    MySQLdb compiled -- Import issue

    Kurian Thayil, Mar 25, 2010, in forum: Python
    Replies:
    3
    Views:
    481
    Sean DiZazzo
    Mar 25, 2010
  5. bruce

    mysqldb - parameter issue

    bruce, Aug 11, 2010, in forum: Python
    Replies:
    0
    Views:
    203
    bruce
    Aug 11, 2010
Loading...

Share This Page