Modifying DYLD_LIBRARY_PATH for mysql, python, and django
<p>I've seen two dozen posts concerning this issue, but I'm so NOOB I'm not sure how to modify everything correctly.</p>

<p>I'm attempting to finish the installation, but when I go to Python and "import MySQLdb" I end up getting:</p>

<pre><code>ImportError: dlopen(/Users/pccampbell/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.5-fat3.egg-tmp/_mysql.so, 2):


Library not loaded: libmysqlclient.16.dylib
</code></pre>

<p>Referenced from: /Users/pccampbell/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.5-fat3.egg-tmp/_mysql.so</p>

<p>I then run this command which everyone says works (and it does, but only temporarily!): </p>

<pre><code>export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/
</code></pre>

<p>SO, I'm trying to execute the following to permanently change the path (as found on another help site):</p>

<pre><code>sudo install_name_tool -change libmysqlclient.16.dylib /usr/local/mysql/lib/libmysqlclient.16.dylib lib/python2.7/site-packages/_mysql.so
</code></pre>

<p>BUT, I end up getting this error:</p>

<pre><code>install_name_tool: can't open file: lib/python2.7/site-packages/_mysql.so (No such file or directory)
</code></pre>

<p>I found the _mysql.so file at, but even when I use this path it doesn't work:</p>

<pre><code>/Users/pccampbell/MySQL-python-1.2.3/build/lib.macosx-10.5-fat3-2.7
</code></pre>

<p>THE BOTTOM LINE: is there a way to permanently modify the DYLD_LIBRARY_PATH, so I don't have to run the export command every time. If so, then could you please, please, please provide the specific syntax, because I've been guessing and checking for a long time. :(</p>

<p>ANy help GREATLY appreciated.</p>

<p>Patrick</p>
