Closed clueboy closed 11 years ago
From msabramo on September 02, 2013 12:05:21
This means that you need to install FreeTDS.
This is easily done on a Mac with:
brew install freetds
port install freetds
You can also compile it from scratch if you don't use a package manager. Make sure to run ./configure with --enable-msdblib so that you don't get dates that are off by 1 month.
Status: WontFix
Owner: msabramo
From markarichman on September 02, 2013 12:25:13
Is there a different mirror I can use? I tried brew install freetds
and get an HTTP 400:
curl: (22) The requested URL returned error: 400 Error: Download failed: http://mirrors.ibiblio.org/freetds/stable/freetds-0.91.tar.gz
From markarichman on September 02, 2013 12:30:23
Downloading the source from http://mirrors.ibiblio.org/freetds/stable/freetds-0.91.tar.gz and doing ./configure --enable-msdblib
allowed pip install pymssql
to build and install successfully. Thank you!!
From msabramo on September 10, 2013 22:18:04
Reopening, because I think that we could add code to setup.py to print some useful info about how to install FreeTDS, kind of like I did with FreeBSD (see https://code.google.com/p/pymssql/issues/detail?id=97#c12 )
Status: Accepted
From markarichman on September 11, 2013 04:51:47
Good call. Please let me know if I may be of assistance in testing this change.
From msabramo on September 18, 2013 22:44:27
Committed this change to add some helpful tips for installing FreeTDS on OS X.
@markarichman, let me know what you think.
Status: Fixed
From markarichman on September 19, 2013 05:53:38
I don't see the change. I'm looking here: https://code.google.com/p/pymssql/source/list Sorry, new to Google Code.
From msabramo on September 19, 2013 07:51:22
@markarichman,
Oops, I forgot to post the link to the change. Note that we recently moved the source code repo from Google Code (Mercurial) to GitHub. https://github.com/pymssql/pymssql/commit/5fddb67623b3f5b64d7cf3804105656861754b29 Let me know if that change would've made installing pymssql on OS X easier for you.
Though I'm now starting to come back to the idea of bundling FreeTDS, since FreeTDS by default builds without --enable-msdblib, which can lead to problems with dates (see https://code.google.com/p/pymssql/wiki/FreeTDSAndDates )
From markarichman on September 19, 2013 08:19:52
Ah yes! Sorry didn't know we switched to GitHub. Yes that message is perfect! The "--enable-msdblib" was the missing magic I needed.
From markarichman on September 01, 2013 16:05:54
I got latest (pymssql-2.0.0b1-dev-20130403).
Here's the fatal error:
_mssql.c:257:10: fatal error: 'sqlfront.h' file not found
Full trace:
mark@macpro:pymssql-2.0.0b1-dev-20130403# python setup.py install Compiling module Cython.Plex.Scanners ... Compiling module Cython.Plex.Actions ... Compiling module Cython.Compiler.Lexicon ... Compiling module Cython.Compiler.Scanning ... Compiling module Cython.Compiler.Parsing ... Compiling module Cython.Compiler.Visitor ... Compiling module Cython.Compiler.FlowControl ... Compiling module Cython.Compiler.Code ... Compiling module Cython.Runtime.refnanny ... warning: no files found matching '.pyx' under directory 'Cython/Debugger/Tests' warning: no files found matching '.pxd' under directory 'Cython/Debugger/Tests' warning: no files found matching '.h' under directory 'Cython/Debugger/Tests' warning: no files found matching '.pxd' under directory 'Cython/Utility' /var/folders/hn/40d_ql_d21n4kg32cc0sd5p40000gn/T/easy_install-M9_3dW/Cython-0.19.1/Cython/Compiler/Code.c:50081:19: warning: expression result unused [-Wunused-value] PyObject_INIT(o, t); ^ /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7/objimpl.h:164:69: note: expanded from macro 'PyObject_INIT' ( Py_TYPE(op) = (typeobj), _Py_NewReference((PyObject *)(op)), (op) ) ^ 1 warning generated.
Installed /Users/mark/pymssql-2.0.0b1-dev-20130403/Cython-0.19.1-py2.7-macosx-10.8-x86_64.egg creating var creating var/folders creating var/folders/hn creating var/folders/hn/40d_ql_d21n4kg32cc0sd5p40000gn creating var/folders/hn/40d_ql_d21n4kg32cc0sd5p40000gn/T cc -arch x86_64 -c /var/folders/hn/40d_ql_d21n4kg32cc0sd5p40000gn/T/clock_gettimeOd2mcR.c -o var/folders/hn/40d_ql_d21n4kg32cc0sd5p40000gn/T/clock_gettimeOd2mcR.o /var/folders/hn/40d_ql_d21n4kg32cc0sd5p40000gn/T/clock_gettimeOd2mcR.c:1:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] main (int argc, char **argv) { ^~~~ /var/folders/hn/40d_ql_d21n4kg32cc0sd5p40000gn/T/clock_gettimeOd2mcR.c:2:5: warning: implicit declaration of function 'clock_gettime' is invalid in C99 [-Wimplicit-function-declaration] clock_gettime(); ^ 2 warnings generated. cc -arch x86_64 var/folders/hn/40d_ql_d21n4kg32cc0sd5p40000gn/T/clock_gettimeOd2mcR.o -lrt -o a.out ld: library not found for -lrt clang: error: linker command failed with exit code 1 (use -v to see invocation) running install running bdist_egg running egg_info writing pymssql.egg-info/PKG-INFO writing top-level names to pymssql.egg-info/top_level.txt writing dependency_links to pymssql.egg-info/dependency_links.txt reading manifest file 'pymssql.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no files found matching 'win32/freetds.zip' writing manifest file 'pymssql.egg-info/SOURCES.txt' installing library code to build/bdist.macosx-10.8-x86_64/egg running install_lib running build_ext skipping '_mssql.c' Cython extension (up-to-date) building '_mssql' extension creating build creating build/temp.macosx-10.8-x86_64-2.7 cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mssql.c -o build/temp.macosx-10.8-x86_64-2.7/_mssql.o -Wno-parentheses-equality -DMSDBLIB _mssql.c:257:10: fatal error: 'sqlfront.h' file not found
include "sqlfront.h"
1 error generated. error: command 'cc' failed with exit status 1
Original issue: http://code.google.com/p/pymssql/issues/detail?id=125