mmatuson / SchemaSync

A MySQL Schema Versioning and Migration Utility
http://mmatuson.github.io/SchemaSync/
Other
337 stars 110 forks source link

schemasync can't find MySQLDb #10

Closed mattsawyer77 closed 13 years ago

mattsawyer77 commented 13 years ago

I know next-to-nothing about Python (and that's probably the real problem here), but I have tried to install MySQLDb 1.2.3 according to the instructions in its README file. I then installed schemasync and got no error messages. But when I try to run schemasync, I see

Error: Missing Required Dependency MySQLdb.

Any clues on how to correct this?

mmatuson commented 13 years ago

The easiest way to install MySQLdb is through your OS's package manager. On Ubuntu you can do sudo apt-get install python-mysqldb

What OS are you trying to install it on?

mattsawyer77 commented 13 years ago

I'm on OSX 10.6, using Homebrew for package management. But since Homebrew doesn't have a package for MySQLdb (and the SchemaSync Homebrew package didn't work either), I'm attempting to install both manually. Do I need to set some sort of environment variable so that SchemaSync can see MySQLdb?

Thanks for your help. Matt

mattsawyer77 commented 13 years ago

I was able to resolve the problem by doing sudo brew install mysql-python sudo brew install schemasync

It seems that the brew file for schemasync simply needs to add mysql-python as a dependency.

mmatuson commented 13 years ago

OK, great. Let me know if there are any other issues.

jeffcrouse commented 12 years ago

I'm on OSX 10.7 and I have the same problem, only I'm not using homebrew. This is what I did:

wget http://downloads.sourceforge.net/project/mysql-python/mysql-python/1.2.3/MySQL-python-1.2.3.tar.gz tar -xvf MySQL-python-1.2.3.tar.gz cd MySQL-python-1.2.3 python setup.py build sudo python setup.py

wget http://www.schemasync.org/downloads/SchemaSync-0.9.2.tar.gz tar xvzf SchemaSync-0.9.2.tar.gz cd SchemaSync-0.9.2 sudo python setup.py install

schemasync --help

The result: Error: Missing Required Dependency MySQLdb.

Any ideas?

mmatuson commented 12 years ago

Jeff, do you get an error if you run python -c"import MySQLdb" ?

jeffcrouse commented 12 years ago

I do get an error:

File "", line 1, in File "build/bdist.macosx-10.7-intel/egg/MySQLdb/init.py", line 19, in File "build/bdist.macosx-10.7-intel/egg/_mysql.py", line 7, in File "build/bdist.macosx-10.7-intel/egg/_mysql.py", line 6, in bootstrap ImportError: dlopen(/Users/jeff/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg-tmp/_mysql.so, 2): Library not loaded: libmysqlclient.18.dylib Referenced from: /Users/jeff/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg-tmp/_mysql.so Reason: image not found

Like the original poster, I have no experience with Python, so I don't even understand why it is looking for something in ~/.python-eggs

Anway, the error message made it clear what was wrong, and I fixed it with the following:

sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib

I suppose you could also add the following to your .profile

export DYLD_LIBRARY_PATH=/usr/local/mysql/lib:$DYLD_LIBRARY_PATH but it wouldn't work for all users

Thanks mmatuson!