Python not importing mysqldb

8

83nini

hi guys,

i've been sweating the whole day trying to make python work with mysql
but in vain!
i'm doing the following:
1. visiting http://sourceforge.net/projects/mysql-python
2. dowloading mysql-python-test-1.2.3c1
3. extracting the files to C:\Python26\Lib\site-packages
4. writing "import MySQLdb" in the python prompt

getting

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python26\lib\site-packages\MySQLdb\__init__.py", line 19,
in <module>

import _mysql
ImportError: No module named _mysql

WHY YYYYYYYYYYYYYYYYYYYYYYYYYYYYY????????
why does it have to be so complicated???? what am i doing wrong for
god's sake?


thanks in advance,
cheers,
Lina
 
J

Jerry Hill

hi guys,

i've been sweating the whole day trying to make python work with mysql
but in vain!
i'm doing the following:
1. visiting http://sourceforge.net/projects/mysql-python
2. dowloading mysql-python-test-1.2.3c1
3. extracting the files to C:\Python26\Lib\site-packages
4. writing "import MySQLdb" in the python prompt

I don't believe step 3 is the proper way to install this extension.

I don't have any personal experience with this package, but it appears
to be a setuptools based extension package. Based on that, I believe
the proper way to install it is to extract all of the files to a
temporary directory and run 'python setup.py install' from the command
line.

It looks like this package also has a _mysql.c file that setuptools
will need to compile. That means you'll need all the appropriate
build tools for compiling c extension modules on windows in a way
that's compatible with your version of python. Alternatively, it
means waiting for someone who does have all of that infrastructure
already set up and working to compile a windows installer.

Also, as Emile pointed out, all of that may be in vain, since python
2.6 doesn't appear to be supported by this extension yet.
 
M

Marco Bizzarri

hi guys,

i've been sweating the whole day trying to make python work with mysql
but in vain!
i'm doing the following:
1. visiting http://sourceforge.net/projects/mysql-python
2. dowloading mysql-python-test-1.2.3c1
3. extracting the files to C:\Python26\Lib\site-packages
4. writing "import MySQLdb" in the python prompt

getting

Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "C:\Python26\lib\site-packages\MySQLdb\__init__.py", line 19,
in <module>

   import _mysql
ImportError: No module named _mysql

WHY YYYYYYYYYYYYYYYYYYYYYYYYYYYYY????????
why does it have to be so complicated???? what am i doing wrong for
god's sake?



Suggestion: install python2.5 for windows, and then download this one:

http://sourceforge.net/project/down...MySQL-python-1.2.2.win32-py2.5.exe&a=71602382

I'm sure you'll save yourself a lot of time.

Regards
Marco
 
I

Ioannis Lalopoulos

Thanx guys for the helpful information, i did as Marco suggested and
it worked.
FINALLLLY :D

cheers,
Lina- Hide quoted text -

- Show quoted text -

For Windows distributions of MySQL-python (MySQLdb module) which work
with python 2.6 (32 and 64bit) take a look here: http://www.codegood.com/archives/4.
Apart from the normal distributions (client) embedded modules (client-
server) are also available.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top