LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 07-27-2004, 04:52 PM   #1
SheldonPlankton
Member
 
Registered: Jun 2004
Posts: 129

Rep: Reputation: 15
python DB-API for MySQL install problem


Okay

I want to write some python scripts that access MySQL.

I first check to see if MySQLdb is install so I do this

Code:
$ python
Python 2.2.2 (#1, Feb 24 2003, 19:13:11)
[GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-4)] 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
>>>
So I install the RPM off my RH9 install CD and this ...
Code:
[root@localhost MySQL-python-1.0.0]# rpm -i /mnt/cdrom/RedHat/RPMS/mx-2.0.3-8.i386.rpm
[root@localhost MySQL-python-1.0.0]# rpm -i /mnt/cdrom/RedHat/RPMS/MySQL-python-0.9.1-6.i386.rpm
[root@localhost MySQL-python-1.0.0]# python
Python 2.2.2 (#1, Feb 24 2003, 19:13:11)
[GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "MySQLdb/__init__.py", line 31, in ?
    raise ImportError, "this is MySQLdb version %s, but _mysql is version %s" %\
ImportError: this is MySQLdb version (1, 0, 0, 'final', 1), but _mysql is version (0, 9, 1, 'final', 1)
>>>
[root@localhost MySQL-python-1.0.0]#

Last edited by SheldonPlankton; 07-27-2004 at 05:29 PM.
 
Old 07-27-2004, 06:55 PM   #2
SheldonPlankton
Member
 
Registered: Jun 2004
Posts: 129

Original Poster
Rep: Reputation: 15
Never mind I forgot to install the mysql-devel RPM like it says to in the README file.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL Client API I_AM Linux - Newbie 1 06-27-2005 03:52 AM
mysql client api I_AM Linux - Newbie 1 06-24-2005 12:48 AM
linking C api for mysql toships Programming 3 04-09-2004 12:29 AM
msql++ c++ api for mysql nakkaya Linux - Software 0 04-19-2003 04:56 PM
c++ and mysql api nakkaya Programming 4 03-29-2003 12:10 AM


All times are GMT -5. The time now is 12:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration