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

  • Home
  • SEARCH
  • 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 4250412
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:31:31+00:00 2026-05-21T04:31:31+00:00

Possible Duplicate: Python import MySQLdb error – Mac 10.6 I’ve tried everything I can

  • 0

Possible Duplicate:
Python import MySQLdb error – Mac 10.6

I’ve tried everything I can find online. I’ve installed mysql using the dmg and I’ve tried installing the mysql-python (which I think worked). But I still get the error when I run in the python interpreter “import MySQLdb”:

>>> import MySQLdb
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "build/bdist.macosx-10.6-universal/egg/MySQLdb/__init__.py", line 19, in <module>

  File "build/bdist.macosx-10.6-universal/egg/_mysql.py", line 7, in <module>
  File "build/bdist.macosx-10.6-universal/egg/_mysql.py", line 6, in __bootstrap__
ImportError: dlopen(/Users/matthew/.python-eggs/MySQL_python-1.2.3-py2.6-macosx-10.6-universal.egg-tmp/_mysql.so, 2): Library not loaded: libmysqlclient.18.dylib
  Referenced from: /Users/matthew/.python-eggs/MySQL_python-1.2.3-py2.6-macosx-10.6-universal.egg-tmp/_mysql.so
  Reason: image not found

I can’t figure out the problem. Ideas on how to track this down?

  • 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-05-21T04:31:32+00:00Added an answer on May 21, 2026 at 4:31 am

    I’ve just installed this on my system and these are the steps I did to make it working:

    1. Download Mysql-python: http://sourceforge.net/projects/mysql-python/files/mysql-python/1.2.2/ (I’ve used 1.2.2 version)
    2. Extract, go there and edit _mysql.c file by removing 37-19 lines (ifdefine)
    3. In site.cfg set mysql_config = /usr/local/mysql/bin/mysql_config
    4. sudo python setup.py build (this one I ran two times, while the first one spitted something weird, second time went without errors… I read about this and this is weird stuff)
    5. sudo python setup.py install
    6. sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib
    7. sudo ln -s /usr/local/mysql/lib/ /usr/local/mysql/lib/mysql

    And finally you just try import MySQLdb in python. Hope that worked also for you.

    Ignas

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

Sidebar

Related Questions

Possible Duplicate: What can you use Python generator functions for? I tried to read
Possible Duplicate: Deleting files by type in Python on Windows How can I delete
Possible Duplicate: Unpythonic way of printing variables in Python? In PHP one can write:
Possible Duplicate: Why can't Python handle true/false values as I expect? False = True
Possible Duplicate: Python: Behaviour of increment and decrement operators Hi, I've tried this. ++num
Possible Duplicate: Reading/Writing MS Word files in Python I know there are some libraries
Possible Duplicate: Converting XML to JSON using Python? I am importing an XML feed
Possible Duplicate: How can I capture the stdout output of a child process? I'm
Possible Duplicate: Multiprocessing launching too many instances of Python VM I am trying python
Possible Duplicate: from . import x using __import__ ? How does one do the

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.