I've previously managed to install MySQLdb 0.9.2 on OS X 10.2 after changing the setup.py file to reflect the accurate locations of the MySQL libraries. It was working without a hitch until I installed OS X 10.3 (Panther).
Now my python cgi scripts can't find the MySQLdb module, and when I try to reinstall the module I get a ton of errors on the build. Anyone else had the same problem?
suggestions greatly appreciated.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm having the same problem - I get a ton of messages about missing files. Here are the first few lines after the first gcc command:
In file included from pymemcompat.h:10,
from _mysql.c:31:
/usr/local/include/python/Python.h:8:22: pyconfig.h: No such file or directory
/usr/local/include/python/Python.h:21:2: #error "limits.h is required by std C -- why isn't HAVE_LIMITS_H defined?"
In file included from /usr/local/include/python/Python.h:28,
from pymemcompat.h:10,
from _mysql.c:31:
/usr/local/include/stdio.h:65:23: sys/types.h: No such file or directory
/usr/local/include/stdio.h:68:23: sys/cdefs.h: No such file or directory
/usr/local/include/stdio.h:70:26: machine/ansi.h: No such file or directory
Has anyone installed MySQLdb successfully on OS X 10.3?
-- Ed
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'd used the MySQL package from mysql.com and had to add the paths where in installs by default to setup.py to make the compiler find the includes/libs. Relevant lines in setup.py look like this:
Problem is, I can't access the MySQL data directory from the Python interpreter or via cgi scripts. Argh. I've played around with ownership/permissions for the past 3 hours and still no luck. Any one figured this out yet?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The main problem I see with those Mac OS X instructions are the shell set commands: You probably need to be using set -x so that those values are exported to subshells.
Please test 1.1.0 (consider an alpha release) as an embedded server; you don't really need to bother with 1.0.0c2 unless you are stuck with Python 1.5.2 (not a problem with Mac OS X).
The embedded server is going to run with the same user id as your web server, so that user will need write access to the database files.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For the benefit of any OS X users who see the messages already on this thread, my experiences were good:
Using MySQLdb 1.0.0 on OS X 10.3.4 (client) with Xcode 1.2 using the standard MySQL 4.0.20 server package from mysql.com, I could mostly follow the instructions in the readme:
cc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/include/mysql -I/usr/local/include/mysql -I/usr/local/mysql/include -I/usr/local/mysql/include/mysql -I/sw/include/mysql -I/System/Library/Frameworks/Python.framework/Versions/2.3/include/python2.3 -c _mysql.c -o build/temp.darwin-7.5.0-Power_Macintosh-2.3/_mysql.o
_mysql.c: In function `_mysql_ConnectionObject_shutdown':
_mysql.c:1545: error: too few arguments to function `mysql_shutdown'
error: command 'gcc' failed with exit status 1
Any ideas? Running 4.1.2-alpha, and MySQLdb 1.0.0
-Simon
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello.
I've previously managed to install MySQLdb 0.9.2 on OS X 10.2 after changing the setup.py file to reflect the accurate locations of the MySQL libraries. It was working without a hitch until I installed OS X 10.3 (Panther).
Now my python cgi scripts can't find the MySQLdb module, and when I try to reinstall the module I get a ton of errors on the build. Anyone else had the same problem?
suggestions greatly appreciated.
I'm having the same problem - I get a ton of messages about missing files. Here are the first few lines after the first gcc command:
In file included from pymemcompat.h:10,
from _mysql.c:31:
/usr/local/include/python/Python.h:8:22: pyconfig.h: No such file or directory
/usr/local/include/python/Python.h:21:2: #error "limits.h is required by std C -- why isn't HAVE_LIMITS_H defined?"
In file included from /usr/local/include/python/Python.h:28,
from pymemcompat.h:10,
from _mysql.c:31:
/usr/local/include/stdio.h:65:23: sys/types.h: No such file or directory
/usr/local/include/stdio.h:68:23: sys/cdefs.h: No such file or directory
/usr/local/include/stdio.h:70:26: machine/ansi.h: No such file or directory
Has anyone installed MySQLdb successfully on OS X 10.3?
-- Ed
I'd used the MySQL package from mysql.com and had to add the paths where in installs by default to setup.py to make the compiler find the includes/libs. Relevant lines in setup.py look like this:
include_dirs = [
'/usr/include/mysql', '/usr/local/include/mysql',
'/usr/local/mysql/include'
]
library_dirs = [
'/usr/lib/mysql', '/usr/local/lib/mysql',
'/usr/local/mysql/lib'
]
The last lines (/usr/local/mysql/include and /usr/local/mysql/lib) are the ones I added.
I managed to get MySQL, MySQLdb, and Python playing together (almost) on OS X using this link:
http://www2.wcer.wisc.edu/Transana/Develop/mysqlMacOSX
Problem is, I can't access the MySQL data directory from the Python interpreter or via cgi scripts. Argh. I've played around with ownership/permissions for the past 3 hours and still no luck. Any one figured this out yet?
The main problem I see with those Mac OS X instructions are the shell set commands: You probably need to be using set -x so that those values are exported to subshells.
Please test 1.1.0 (consider an alpha release) as an embedded server; you don't really need to bother with 1.0.0c2 unless you are stuck with Python 1.5.2 (not a problem with Mac OS X).
The embedded server is going to run with the same user id as your web server, so that user will need write access to the database files.
For the benefit of any OS X users who see the messages already on this thread, my experiences were good:
Using MySQLdb 1.0.0 on OS X 10.3.4 (client) with Xcode 1.2 using the standard MySQL 4.0.20 server package from mysql.com, I could mostly follow the instructions in the readme:
$ export mysqlversion="4.0.20"
$ export mysqlclient="mysqlclient_r"
$ python setup.py build
$ sudo python setup.py install
However I did first need to comment out the lines in setup.py that read:
if mysqlversion > (4,0,0):
libraries.append("crypt")
because I have no such library.
I get this error:
cc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/include/mysql -I/usr/local/include/mysql -I/usr/local/mysql/include -I/usr/local/mysql/include/mysql -I/sw/include/mysql -I/System/Library/Frameworks/Python.framework/Versions/2.3/include/python2.3 -c _mysql.c -o build/temp.darwin-7.5.0-Power_Macintosh-2.3/_mysql.o
_mysql.c: In function `_mysql_ConnectionObject_shutdown':
_mysql.c:1545: error: too few arguments to function `mysql_shutdown'
error: command 'gcc' failed with exit status 1
Any ideas? Running 4.1.2-alpha, and MySQLdb 1.0.0
-Simon
Just tried 1.1.1 & get the same problem.
This is fixed in 1.1.2. The API changed in MySQL-4.1.3.