-1

I installed python mysqldb with command: apt-get install python-mysqldb, everything was fine but I cannot open any python script with:

 import mysqldb

I still get information:

ImportError: No module named mysqldb

Any idea what to do? I'm using Ubuntu 12.04

Łukasz Kluczny
  • 117
  • 2
  • 9

1 Answers1

2

The name of the module is MySQLdb not mysqldb, so try instead:

import MySQLdb

But you really could have found the mistake on your own within a minute with the help of a quick Google search...

(see also: How do I connect to a MySQL Database in Python?)

Community
  • 1
  • 1
Erik Kaplun
  • 37,128
  • 15
  • 99
  • 111