Hey, I found by Time Machine on my old disk two versions of MySQL python. Yesterday I was trying the full MySQL-python-1.2.3, but I had on my old disk those two versions: MySQL-python-1.2.3c1 - after install looked like the full version, but error message was saying something more:
>>> import MySQLdb /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/site-packages/MySQL_python-1.2.3c1-py2.6-macosx-10.6- x86_64.egg/_mysql.py:3: UserWarning: Module _mysql was already imported from /opt/local/Library/Frameworks/Python.framework/Versions/ 2.6/lib/python2.6/site-packages/MySQL_python-1.2.3c1-py2.6-macosx-10.6- x86_64.egg/_mysql.pyc, but /Users/mIREK/www/_base/MySQL-python-1.2.3c1 is being added to sys.path Traceback (most recent call last): File "<stdin>", line 1, in <module> File "MySQLdb/__init__.py", line 19, in <module> import _mysql File "build/bdist.macosx-10.6-x86_64/egg/_mysql.py", line 7, in <module> File "build/bdist.macosx-10.6-x86_64/egg/_mysql.py", line 6, in __bootstrap__ ImportError: dlopen(/Users/mIREK/.python-eggs/MySQL_python-1.2.3c1- py2.6-macosx-10.6-x86_64.egg-tmp/_mysql.so, 2): Library not loaded: / usr/local/mysql/lib/libmysqlclient_r.16.dylib Referenced from: /Users/mIREK/.python-eggs/MySQL_python-1.2.3c1- py2.6-macosx-10.6-x86_64.egg-tmp/_mysql.so Reason: Incompatible library version: _mysql.so requires version 17.0.0 or later, but libmysqlclient_r.16.dylib provides version 16.0.0 >>> The message specifies the versions of the library... MySQL-python-1.2.3b2 - I tried this and is working fine. I don't see it as the clearist solution, so I can finished something in work and then i would like to try your solution... I wonder if the "c1" version is not saying the problem what the full version is not... I have exported the PATH with mysql directory in my .profile file and is working. Just wonder why mysql_python copies almost everything to the python istallation site-peckages directory, but even through that is creating .python-eggs directory in my profile where _mysql.so is located too. mIREK On 21 říj, 20:49, mart <msenecal...@gmail.com> wrote: > Hey, > > that is a sys env issue ;) you would need to look at your user profile > and make sure all sys paths are in line with what is expected... did > you try doing an export of the path? > > I did spot something new that may help: > > http://friendlybit.com/tutorial/install-mysql-python-on-mac-os-x-leop... > > let me know how it works out > > Mart :) > > On Oct 21, 9:49 am, mIREK <mko...@gmail.com> wrote: > > > > > > > > > Hi Mart and Franklin, > > > I have the same problem. I have OS X 10.6 with MySQL from binary > > installer. I am using python 2.6.6 from ports and yes I have switched > > it by python_select. I am trying to build it from sources, beacuse > > py26-mysql is also "building" mysql5 which I do not want, when I have > > it from installer... > > > Last time year ago it works perfectly on 1.2.3b and I didn't even > > think there should be a problem, but now after complete reinstall of > > the system I want back my working mysql ;-) > > > Here's what I got after build and install: > > > bash-3.2# python setup.py build > > running build > > running build_py > > copying MySQLdb/release.py -> build/lib.macosx-10.6-x86_64-2.6/MySQLdb > > running build_ext > > > bash-3.2# python setup.py install > > running install > > running bdist_egg > > running egg_info > > writing MySQL_python.egg-info/PKG-INFO > > writing top-level names to MySQL_python.egg-info/top_level.txt > > writing dependency_links to MySQL_python.egg-info/dependency_links.txt > > reading manifest file 'MySQL_python.egg-info/SOURCES.txt' > > reading manifest template 'MANIFEST.in' > > warning: no files found matching 'MANIFEST' > > warning: no files found matching 'ChangeLog' > > warning: no files found matching 'GPL' > > writing manifest file 'MySQL_python.egg-info/SOURCES.txt' > > installing library code to build/bdist.macosx-10.6-x86_64/egg > > running install_lib > > running build_py > > copying MySQLdb/release.py -> build/lib.macosx-10.6-x86_64-2.6/MySQLdb > > running build_ext > > creating build/bdist.macosx-10.6-x86_64/egg > > copying build/lib.macosx-10.6-x86_64-2.6/_mysql.so -> build/ > > bdist.macosx-10.6-x86_64/egg > > copying build/lib.macosx-10.6-x86_64-2.6/_mysql_exceptions.py -> build/ > > bdist.macosx-10.6-x86_64/egg > > creating build/bdist.macosx-10.6-x86_64/egg/MySQLdb > > copying build/lib.macosx-10.6-x86_64-2.6/MySQLdb/__init__.py -> build/ > > bdist.macosx-10.6-x86_64/egg/MySQLdb > > copying build/lib.macosx-10.6-x86_64-2.6/MySQLdb/connections.py -> > > build/bdist.macosx-10.6-x86_64/egg/MySQLdb > > creating build/bdist.macosx-10.6-x86_64/egg/MySQLdb/constants > > copying build/lib.macosx-10.6-x86_64-2.6/MySQLdb/constants/__init__.py > > -> build/bdist.macosx-10.6-x86_64/egg/MySQLdb/constants > > copying build/lib.macosx-10.6-x86_64-2.6/MySQLdb/constants/CLIENT.py -> > > build/bdist.macosx-10.6-x86_64/egg/MySQLdb/constants > > > copying build/lib.macosx-10.6-x86_64-2.6/MySQLdb/constants/CR.py -> > > build/bdist.macosx-10.6-x86_64/egg/MySQLdb/constants > > copying build/lib.macosx-10.6-x86_64-2.6/MySQLdb/constants/ER.py -> > > build/bdist.macosx-10.6-x86_64/egg/MySQLdb/constants > > copying build/lib.macosx-10.6-x86_64-2.6/MySQLdb/constants/ > > FIELD_TYPE.py -> build/bdist.macosx-10.6-x86_64/egg/MySQLdb/constants > > copying build/lib.macosx-10.6-x86_64-2.6/MySQLdb/constants/FLAG.py -> > > build/bdist.macosx-10.6-x86_64/egg/MySQLdb/constants > > copying build/lib.macosx-10.6-x86_64-2.6/MySQLdb/constants/REFRESH.py -> > > build/bdist.macosx-10.6-x86_64/egg/MySQLdb/constants > > > copying build/lib.macosx-10.6-x86_64-2.6/MySQLdb/converters.py -> > > build/bdist.macosx-10.6-x86_64/egg/MySQLdb > > copying build/lib.macosx-10.6-x86_64-2.6/MySQLdb/cursors.py -> build/ > > bdist.macosx-10.6-x86_64/egg/MySQLdb > > copying build/lib.macosx-10.6-x86_64-2.6/MySQLdb/release.py -> build/ > > bdist.macosx-10.6-x86_64/egg/MySQLdb > > copying build/lib.macosx-10.6-x86_64-2.6/MySQLdb/times.py -> build/ > > bdist.macosx-10.6-x86_64/egg/MySQLdb > > byte-compiling build/bdist.macosx-10.6-x86_64/egg/_mysql_exceptions.py > > to _mysql_exceptions.pyc > > byte-compiling build/bdist.macosx-10.6-x86_64/egg/MySQLdb/__init__.py > > to __init__.pyc > > byte-compiling build/bdist.macosx-10.6-x86_64/egg/MySQLdb/ > > connections.py to connections.pyc > > byte-compiling build/bdist.macosx-10.6-x86_64/egg/MySQLdb/constants/ > > __init__.py to __init__.pyc > > byte-compiling build/bdist.macosx-10.6-x86_64/egg/MySQLdb/constants/ > > CLIENT.py to CLIENT.pyc > > byte-compiling build/bdist.macosx-10.6-x86_64/egg/MySQLdb/constants/ > > CR.py to CR.pyc > > byte-compiling build/bdist.macosx-10.6-x86_64/egg/MySQLdb/constants/ > > ER.py to ER.pyc > > byte-compiling build/bdist.macosx-10.6-x86_64/egg/MySQLdb/constants/ > > FIELD_TYPE.py to FIELD_TYPE.pyc > > byte-compiling build/bdist.macosx-10.6-x86_64/egg/MySQLdb/constants/ > > FLAG.py to FLAG.pyc > > byte-compiling build/bdist.macosx-10.6-x86_64/egg/MySQLdb/constants/ > > REFRESH.py to REFRESH.pyc > > byte-compiling build/bdist.macosx-10.6-x86_64/egg/MySQLdb/ > > converters.py to converters.pyc > > byte-compiling build/bdist.macosx-10.6-x86_64/egg/MySQLdb/cursors.py > > to cursors.pyc > > byte-compiling build/bdist.macosx-10.6-x86_64/egg/MySQLdb/release.py > > to release.pyc > > byte-compiling build/bdist.macosx-10.6-x86_64/egg/MySQLdb/times.py to > > times.pyc > > creating stub loader for _mysql.so > > byte-compiling build/bdist.macosx-10.6-x86_64/egg/_mysql.py to > > _mysql.pyc > > creating build/bdist.macosx-10.6-x86_64/egg/EGG-INFO > > copying MySQL_python.egg-info/PKG-INFO -> build/bdist.macosx-10.6- > > x86_64/egg/EGG-INFO > > copying MySQL_python.egg-info/SOURCES.txt -> build/bdist.macosx-10.6- > > x86_64/egg/EGG-INFO > > copying MySQL_python.egg-info/dependency_links.txt -> build/ > > bdist.macosx-10.6-x86_64/egg/EGG-INFO > > copying MySQL_python.egg-info/top_level.txt -> build/bdist.macosx-10.6- > > x86_64/egg/EGG-INFO > > writing build/bdist.macosx-10.6-x86_64/egg/EGG-INFO/native_libs.txt > > zip_safe flag not set; analyzing archive contents... > > creating 'dist/MySQL_python-1.2.3-py2.6-macosx-10.6-x86_64.egg' and > > adding 'build/bdist.macosx-10.6-x86_64/egg' to it > > removing 'build/bdist.macosx-10.6-x86_64/egg' (and everything under > > it) > > Processing MySQL_python-1.2.3-py2.6-macosx-10.6-x86_64.egg > > Copying MySQL_python-1.2.3-py2.6-macosx-10.6-x86_64.egg to /opt/local/ > > Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site- > > packages > > Adding MySQL-python 1.2.3 to easy-install.pth file > > > Installed /opt/local/Library/Frameworks/Python.framework/Versions/2.6/ > > lib/python2.6/site-packages/MySQL_python-1.2.3-py2.6-macosx-10.6- > > x86_64.egg > > Processing dependencies for MySQL-python==1.2.3 > > Finished processing dependencies for MySQL-python==1.2.3 > > > I found the files under /opt/local/Library/Frameworks/Python.framework/ > > Versions/2.6/lib/python2.6/site-packages/ here I can see > > MySQL_python-1.2.3-py2.6-macosx-10.6-x86_64.egg and in easy- > > install.pth is line ./MySQL_python-1.2.3-py2.6-macosx-10.6-x86_64.egg > > > but still after importing in python I got: > > > mIREK$ python > > Python 2.6.6 (r266:84292, Sep 27 2010, 23:02:58) > > [GCC 4.2.1 (Apple Inc. build 5664)] on darwin > > Type "help", "copyright", "credits" or "license" for more information.>>> > > import MySQLdb > > > Traceback (most recent call last): > > File "<stdin>", line 1, in <module> > > File "build/bdist.macosx-10.6-x86_64/egg/MySQLdb/__init__.py", line > > 19, in <module> > > File "build/bdist.macosx-10.6-x86_64/egg/_mysql.py", line 7, in > > <module> > > File "build/bdist.macosx-10.6-x86_64/egg/_mysql.py", line 6, in > > __bootstrap__ > > ImportError: dlopen(/Users/mIREK/.python-eggs/MySQL_python-1.2.3-py2.6- > > macosx-10.6-x86_64.egg-tmp/_mysql.so, 2): Library not loaded: > > libmysqlclient.16.dylib > > Referenced from: /Users/mIREK/.python-eggs/MySQL_python-1.2.3-py2.6- > > macosx-10.6-x86_64.egg-tmp/_mysql.so > > Reason: image not found > > > I really don't know what to do/try more... > > > mIREK > > > On 20 říj, 19:18, mart <msenecal...@gmail.com> wrote:> few questions: > > > * were you able to install it without any errors? > > > * that pah below... is pointing to temp... Can you check where it has > > > been installed to and are sure that what you have os for 2.6, and not > > > 2.7? - 2.6 is you current version and you have a a path set to it? > > > (pointing to the actual folder or a link?) > > > > On Oct 20, 9:13 am, Franklin Freitas <freitas.frank...@gmail.com> > > > wrote: > > > > > Hi Mart, > > > > > Thanks for your detailed explanation. I had tried before with out any > > > > results. I tried it again anyway from scratch and here is the error I > > > > get when trying to 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/ffreitas/.python-eggs/MySQL_python-1.2.3- > > > > py2.6-macosx-10.6-universal.egg-tmp/_mysql.so, 2): Library not loaded: > > > > libmysqlclient.16.dylib > > > > Referenced from: /Users/ffreitas/.python-eggs/MySQL_python-1.2.3- > > > > py2.6-macosx-10.6-universal.egg-tmp/_mysql.so > > > > Reason: image not found > > > > > On Oct 18, 1:33 pm, mart <msenecal...@gmail.com> wrote: > > > > > > Yes, a little more involved that I remembered. So, to go through the > > > > > steps correctly, I started from scratch. This is what I did: > > > > > > 1) downloaded latest version of MySQLdb > > > > > formhttp://sourceforge.net/projects/mysql-python/ > > > > > 2) went to my default Python folder, and checked for any file or > > > > > folder with a reference to *MySQL* (remove if any) > > > > > 3) opened Vim in a terminal, opened setup_posix.py and made this > > > > > change (you may not have to do this... > > číst dál »