Closed AndiH closed 8 years ago
Same for me: pip install oursql
... clang -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Qunused-arguments -Qunused-arguments -I/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c oursqlx/compat.c -o build/temp.macosx-10.11-x86_64-2.7/oursqlx/compat.o -I/usr/local/Cellar/mysql/5.7.9/include/mysql -fno-omit-frame-pointer In file included from oursqlx/compat.c:55: oursqlx/_exceptions.c:620:24: error: use of undeclared identifier 'ER_ERROR_FIRST' if (err >= ER_ERROR_FIRST && err <= ER_ERROR_LAST) ^ oursqlx/_exceptions.c:620:49: error: use of undeclared identifier 'ER_ERROR_LAST' if (err >= ER_ERROR_FIRST && err <= ER_ERROR_LAST) ^ 2 errors generated. error: command 'clang' failed with exit status 1
----------------------------------------
(env)mbp:devportal allexx$ clang --version Apple LLVM version 7.0.0 (clang-700.1.76) Target: x86_64-apple-darwin15.0.0 Thread model: posigcc
(env)mbp:devportal allexx$ gcc --version Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 7.0.0 (clang-700.1.76) Target: x86_64-apple-darwin15.0.0 Thread model: posix
This broke because of a change in recent versions of mysql. ER_ERROR_FIRST is defined in /usr/local/include/mysql/mysqld_error.h. This constant was removed somewhere between mysql 5.6.26 and mysql 5.7.9. Switching to mysql 5.6.26 should solve the issue until oursql devs update their code.
I had the same error, this solved it for me: 1- Download the package manually. 2- Go to: DOWNLOAD_DIR/oursql-0.9.3.1/oursqlx/_exceptions.c 3- Comment the last “default” (from line 613 to line 623) 4- Run: python setup.py install
For me,
pip install oursql
fails with the following error messageThe same is true when cloning the repo manually and installing via
python setup.py build_ext
. I tested it with and without Cython installed (the latter only for thepip
-based installation). Apart for my default compilerclang
(v. clang-700.1.76) I tested it also forgcc
(v. gcc 5.2.0 --without-multilib). I'm running OS X 10.11.1.Commenting out lines 620 and 621 (and removing the
else
from line 622) in _exceptions.c solves the problem for me, but this surely suppressed some errors, so it's only an intermediate solution.