rennat
rennat

Reputation: 2559

installing/building pymssql on Mac OS 10.6 (python 2.6)

As instructed in the README and here http://code.google.com/p/pymssql/wiki/Compilation, I've installed Cython (v0.14.1), FreeTDS (v0.82 using MacPorts), and I already have XCode installed with gcc.

I've run into build errors during python setup.py install: a lot of undeclared name not builtin: with things like strlen, PyMem_Malloc, PyMem_Free, PY_LONG_LONG as well as a few ___ is deprecated, use 'cpython'

Google found me this thread http://groups.google.com/group/cython-users/browse_thread/thread/468bb80480ede699/dc8267a4274c2413 where someone addresses the first error (changed to from libc.string cimport strlen, strcpy from from stdlib cimport strlen, strcpy.)

Now I'm getting: _mssql.pyx:650:34: Cannot convert Python object to 'const_char *'

Here is the file that these issues are coming from http://code.google.com/p/pymssql/source/browse/tags/1.9.908/_mssql.pyx

My question:

If I have not prepared my system correctly for pymssql what have I done wrong?

or

If the _mssql.pyx file is using deprecated imports how do I fix them?

Upvotes: 0

Views: 2154

Answers (3)

Drewes
Drewes

Reputation: 2697

This fork compiles like a charm:

https://github.com/blackbass1988/pymssql-macos-lion

Upvotes: 0

kermatt
kermatt

Reputation: 1682

Have you tried building 1.9.909 from the trunk? It builds cleanly for me, where .908 did not.

Unfortunately I get import errors even though there is a successful build and install: Building pymssql on OS X

Upvotes: 1

Darrell
Darrell

Reputation: 11

I have pip installed so I obtained Cython using:

pip install Cython

I went to www.freetds.org and got the cvs command to download the latest source (User Guide then "What to build: Packages, Tarballs, and the CVS repository"). To build this, ignore the instructions on the web site and look at the file INSTALL.CVS in the root of the repository you just downloaded. When you run ./autogen.sh use:

./autogen.sh --with-tdsver=7.0

the autogen.sh will create a configure script then the configure script will get the switch. You need to be using 7.0 for python to work with TDS and MS SQL. After the autogen.sh you do a 'make' then a 'sudo make install'.

Now you need the pymssql tarball. Unpack it and run:

python setup.py config
python setup.py build
sudo python setup.py install

that should do it.

Upvotes: 1

Related Questions