他大家好,我一直在尝试安装pymssql,我收到以下错误
Collecting pymssql
Using cached pymssql-2.1.1.tar.gz
setup.py: platform.system() => 'Linux'
setup.py: platform.architecture() => ('64bit', 'ELF')
setup.py: platform.linux_distribution() => ('CentOS', '6.6', 'Final')
setup.py: platform.libc_ver() => ('glibc', '2.2.5')
setup.py: Not using bundled FreeTDS
setup.py: include_dirs = ['/usr/local/include']
setup.py: library_dirs = ['/usr/local/lib']
Installed /tmp/pip-build-xdzeoR/pymssql/setuptools_git-1.1-py2.6.egg
Installing collected packages: pymssql
Running setup.py install for pymssql
setup.py: platform.system() => 'Linux'
setup.py: platform.architecture() => ('64bit', 'ELF')
setup.py: platform.linux_distribution() => ('CentOS', '6.6', 'Final')
setup.py: platform.libc_ver() => ('glibc', '2.2.5')
setup.py: Not using bundled FreeTDS
setup.py: include_dirs = ['/usr/local/include']
setup.py: library_dirs = ['/usr/local/lib']
building '_mssql' extension
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/local/include -I/usr/include/python2.6 -c _mssql.c -o build/temp.linux-x86_64-2.6/_mssql.o -DMSDBLIB
_mssql.c:314:22: error: sqlfront.h: No such file or directory
In file included from _mssql.c:316:
cpp_helpers.h:34:19: error: sybdb.h: No such file or directory
_mssql.c:532: error: expected specifier-qualifier-list before ‘BYTE’
_mssql.c:683: error: expected specifier-qualifier-list before ‘DBPROCESS’
_mssql.c:722: error: expected specifier-qualifier-list before ‘DBPROCESS’
_mssql.c:775: error: expected declaration specifiers or ‘...’ before ‘BYTE’
_mssql.c:776: error: expected declaration specifiers or ‘...’ before ‘BYTE’
_mssql.c:1027: warning: parameter names (without types) in function declaration
_mssql.c:1031: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__Pyx_PyInt_from_py_DBINT’
_mssql.c:1209: error: expected ‘)’ before ‘*’ token
_mssql.c:1210: error: expected ‘)’ before ‘*’ token
_mssql.c:1211: error: expected ‘)’ before ‘*’ token
_mssql.c:1212: error: expected ‘)’ before ‘*’ token
_mssql.c:1214: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__pyx_f_6_mssql_db_cancel’
_mssql.c:1215: error: expected ‘)’ before ‘struct’
_mssql.c:1216: error: expected ‘)’ before ‘struct’
_mssql.c:1226: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mssql.c:1227: error: expected ‘)’ before ‘*’ token
_mssql.c:1228: error: expected ‘)’ before ‘*’ token
_mssql.c:2705: error: expected ‘)’ before ‘*’ token
_mssql.c:3097: error: expected ‘)’ before ‘*’ token
_mssql.c:3570: error: expected ‘)’ before ‘*’ token
_mssql.c:3669: error: expected ‘)’ before ‘*’ token
错误甚至更长.....无论如何,我发现了其他与此相关的问题,我已经检查过(如果缺少则安装)python-dev,freetds-dev,Cython。你能看到我错过的吗?
答案 0 :(得分:0)
对我来说,在red hat 6上,问题是设置是在错误的目录中查找头文件。创建一个符号链接到这个目录,然后重新安装pymssql解决了这个问题:
ln -s /usr/include/freetds/ /usr/local/freetds
我希望这会有所帮助