Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python.': 0.04; 'importerror:': 0.07; 'python': 0.08; 'path.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'referenced': 0.09; 'setup.py': 0.09; 'library': 0.13; 'binary': 0.13; 'skip:" 40': 0.15; 'appreciated!': 0.16; 'egg': 0.16; 'from:addr:acm.org': 0.16; 'installer,': 0.16; 'post:': 0.16; 'read:': 0.16; 'received:198.144': 0.16; 'setuptools': 0.16; 'skip:d 70': 0.16; 'sudo': 0.16; 'variable.': 0.16; 'url:blog': 0.17; 'wrote:': 0.18; 'problem?': 0.18; 'trying': 0.21; '(most': 0.21; 'downloaded': 0.21; 'releasing': 0.23; 'libraries': 0.24; 'traceback': 0.24; 'loaded': 0.25; 'module': 0.26; "i'm": 0.26; 'import': 0.27; 'fix': 0.27; 'error': 0.29; 'environment': 0.30; 'ran': 0.30; 'url:post': 0.30; 'installed': 0.31; 'anyone': 0.31; 'does': 0.32; 'received:198': 0.32; 'pretty': 0.32; 'header:User- Agent:1': 0.33; 'header:X-Complaints-To:1': 0.33; 'there': 0.33; 'to:addr:python-list': 0.34; 'last):': 0.34; 'see,': 0.34; 'record': 0.35; 'test': 0.35; 'project': 0.35; 'skip:" 20': 0.35; 'install': 0.35; 'file': 0.36; 'greatly': 0.36; 'example,': 0.37; 'skip:_ 10': 0.37; 'received:org': 0.38; 'client': 0.39; 'from:': 0.39; 'either': 0.39; 'being': 0.39; 'help': 0.39; 'to:addr:python.org': 0.40; 'full': 0.62; '19,': 0.68; 'article': 0.74 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Ned Deily Subject: Re: importing MySQLdb Date: Fri, 30 Dec 2011 02:45:02 -0800 References: <4EFB9D6D.3080506@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: baybryj.net User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 51 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1325241919 news.xs4all.nl 6888 [2001:888:2000:d::a6]:36474 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:18202 In article <4EFB9D6D.3080506@gmail.com>, Dilara Ally wrote: > I'm trying to import the MySQLdb for python. I downloaded the proper > setuptools egg (ver2.7) for a Mac with OSX10.6 > > I then downloaded the MySQL-python-1.2.3 and ran the following commands > > python setup.py build > sudo python setup.py install > > Then to test that the module was properly loaded I used the interactive > python prompt ad ran the following command: > > import MySQLdb > > The error message read: > > Traceback (most recent call last): > File "", line 1, in > File "MySQLdb/__init__.py", line 19, in > import _mysql > File "build/bdist.macosx-10.6-intel/egg/_mysql.py", line 7, in > File "build/bdist.macosx-10.6-intel/egg/_mysql.py", line 6, in > __bootstrap__ > ImportError: > dlopen(/Users/dally/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.6-intel.eg > g-tmp/_mysql.so, > 2): Library not loaded: libmysqlclient.18.dylib > Referenced from: > /Users/dally/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.6-intel.egg-tmp/_ > mysql.so > Reason: image not found > > Does anyone have any ideas on how to fix this problem? Any help will be > greatly appreciated! If you installed the MySQL client libraries from a MySQL binary installer, chances are that the library name in the client library does not contain the full path. The MySQL project has a pretty dismal record for releasing faulty OS X binaries. There are a few workarounds, the best being either to use install_name_tool to fix the path or to set the DYLD_LIBRARY_PATH environment variable. See, for example, this blog post: http://www.blog.bridgeutopiaweb.com/post/how-to-fix-mysql-load-issues-on- mac-os-x/ -- Ned Deily, nad@acm.org