LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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, 03: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 04:29 PM.
 
Old 07-27-2004, 05: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 02:52 AM
mysql client api I_AM Linux - Newbie 1 06-23-2005 11:48 PM
linking C api for mysql toships Programming 3 04-08-2004 11:29 PM
msql++ c++ api for mysql nakkaya Linux - Software 0 04-19-2003 03:56 PM
c++ and mysql api nakkaya Programming 4 03-28-2003 11:10 PM


All times are GMT -5. The time now is 06:42 PM.

Main Menu
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