Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8088025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:58:20+00:00 2026-06-05T18:58:20+00:00

>>> import MySQLdb Traceback (most recent call last): File <stdin>, line 1, in <module>

  • 0
>>> import MySQLdb
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "build/bdist.macosx-10.6-intel/egg/MySQLdb/__init__.py", line 19, in <module>
  File "build/bdist.macosx-10.6-intel/egg/_mysql.py", line 7, in <module>
  File "build/bdist.macosx-10.6-intel/egg/_mysql.py", line 6, in __bootstrap__
ImportError: dlopen(/Users/samwu/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.6-intel.egg-tmp/_mysql.so, 2): no suitable image found.  Did find:
    /Users/samwu/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.6-intel.egg-tmp/_mysql.so: mach-o, but wrong architecture

I think the problem must be the 64bit version of python and mysql and the img _mysql.so must be 32bit

can anybd give me some suggestions

thx advc!

———append1——

I install MySQLdb just by modify the mysql_config.path = options[‘mysql_config’] in setup_posix.py and then rebuild like this python setup.py build and install,the mysql_config is point to your mysql

———append2——

I can import MySQLdb,but it doesn’t work in pydev

I checked the location of MySQLdb module in python shell like this :

import MySQLdb
print MySQLdb.__file__

/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MySQL_python-1.2.3-py2.7-macosx-10.6-intel.egg/MySQLdb/_init_.pyc

then I add the egg to my pydev lib.it works

[CLOSED]

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T18:58:23+00:00Added an answer on June 5, 2026 at 6:58 pm

    Do you have multiple versions of python installed? It may have installed to your non-default version and therefore won’t work with it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

import MySQLdb and traceback: Traceback (most recent call last): File D:\zjm_code\sphinx_test\a.py, line 1, in
I'm getting this error Traceback (most recent call last): File /home/<username>/flup/server/fcgi_base.py, line 558, in
I can import MySQLdb from the interactive python command line but Zope gives me
So I have a file that looks like so: #!/usr/bin/python import MySQLdb import subprocess
After I installed MySQLdb by sudo apt-get install python-mysqldb I can import and use
import sys sys.path.append('/home/myuser/svn-repos/myproject') from myproject.settings import * But, it says module not found when
I need to connect MySQLdb - module. I download MySQLdb - module and install
I am using crontab to run a python script that requires the module MySQLdb.
I am using python 2.7 and MySQLdb, while doing import MySQLdb its throwing below
import MySQLdb x=raw_input('user> ') y=raw_input('passwd> ') db=MySQLdb.Connect(host=localhost, user=%s, passwd=%s % x,y) cursor=db.cursor() cursor.execute('GRANT ALL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.