安装pyodbc

时间:2018-04-18 20:24:58

标签: python python-2.7 gcc pyodbc python-2.6

我在Redhat 6.5上安装pyodbc。安装了Python 2.6和2.7.4。即使gcc所需的头文件位于/usr/include/python2.6中,我也会收到以下错误。

我已经更新了每个开发包:yum groupinstall -y'开发工具'

如何解决这个问题的任何想法都将非常感谢???

安装pyodbc ...
处理./pyodbc-3.0.10.tar.gz
安装收集的软件包:pyodbc
 为pyodbc运行setup.py安装...错误
    命令/ opt / rh / python27 / root / usr / bin / python -u -c&#34完成输出;导入setuptools,tokenize; 文件 =' / tmp / pip-JAGZDD -build / setup.py&#39 ;; exec(编译(getattr(tokenize,'打开',打开)(文件)。read()。replace(' \ r \ n',' \ n'),文件,' exec'))" install --record /tmp/pip-QJasL0-record/install-record.txt --single-version-external-managed --compile:
    运行安装
    正在建造中     运行build_ext
    建筑' pyodbc'扩展
    创造建筑     创建build / temp.linux-x86_64-2.7
    创建build / temp.linux-x86_64-2.7 / tmp
    创建build / temp.linux-x86_64-2.7 / tmp / pip-JAGZDD-build
    创建build / temp.linux-x86_64-2.7 / tmp / pip-JAGZDD-build / src
    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 -DPYODBC_VERSION = 3.0.10 -DPYODBC_UNICODE_WIDTH = 4 -DSQL_WCHART_CONVERT = 1 -I / Applications / Xcode.app / Contents / Developer / Platforms / MacOSX.platform / Developer / SDKs / MacOSX10.8.sdk / usr / include -I / opt / rh / python27 / root / usr / include / python2.7 -c /tmp/pip-JAGZDD-build/src/cnxninfo.cpp -o build / temp.linux-x86_64-2.7 / tmp / pip-JAGZDD-build /src/cnxninfo.o -Wno-write-strings
    在/tmp/pip-JAGZDD-build/src/cnxninfo.cpp:8中包含的文件中:     **

** / tmp / pip-JAGZDD-build / src / pyodbc.h:41:20:错误:Python.h:没有这样的文件或目录
/ tmp / pip-JAGZDD-build / src / pyodbc.h:42:25:错误:floatobject.h:没有这样的文件或目录
/tmp/pip-JAGZDD-build/src/pyodbc.h:43:24:错误:longobject.h:没有这样的文件或目录
/tmp/pip-JAGZDD-build/src/pyodbc.h:44:24:错误:boolobject.h:没有这样的文件或目录
/ tmp / pip-JAGZDD-build / src / pyodbc.h:45:27:错误:unicodeobject.h:没有这样的文件或目录
/tmp/pip-JAGZDD-build/src/pyodbc.h:46:26:错误:structmember.h:没有这样的文件或目录

**     在/tmp/pip-JAGZDD-build/src/pyodbc.h:137中包含的文件中,
                     来自/tmp/pip-JAGZDD-build/src/cnxninfo.cpp:8:
    /tmp/pip-JAGZDD-build/src/pyodbccompat.h:61:28:错误:stringobject.h:没有这样的文件或目录
    /tmp/pip-JAGZDD-build/src/pyodbccompat.h:62:25:错误:intobject.h:没有这样的文件或目录
    /tmp/pip-JAGZDD-build/src/pyodbccompat.h:63:28:错误:bufferobject.h:没有这样的文件或目录
    在/tmp/pip-JAGZDD-build/src/cnxninfo.cpp:8中包含的文件中:     /tmp/pip-JAGZDD-build/src/pyodbc.h:在函数'void _strlwr(char *)'中:
    /tmp/pip-JAGZDD-build/src/pyodbc.h:92:错误:此范围内未声明'tolower'
    在/tmp/pip-JAGZDD-build/src/pyodbc.h:137中包含的文件中,
                     来自/tmp/pip-JAGZDD-build/src/cnxninfo.cpp:8:
    /tmp/pip-JAGZDD-build/src/pyodbccompat.h:全球范围:
    /tmp/pip-JAGZDD-build/src/pyodbccompat.h:71:错误:'*'标记前的预期初始化程序
    /tmp/pip-JAGZDD-build/src/pyodbccompat.h:81:错误:'Text_Buffer'声明为'内联'变量
    /tmp/pip-JAGZDD-build/src/pyodbccompat.h:81:错误:此范围内未声明'PyObject'
    /tmp/pip-JAGZDD-build/src/pyodbccompat.h:81:错误:此范围内未声明'o'
    /tmp/pip-JAGZDD-build/src/pyodbccompat.h:82:错误:在'{'标记之前预期','或';'     /tmp/pip-JAGZDD-build/src/pyodbccompat.h:93:错误:'Text_Check'声明为'内联'变量
    /tmp/pip-JAGZDD-build/src/pyodbccompat.h:93:错误:此范围内未声明'PyObject'
    /tmp/pip-JAGZDD-build/src/pyodbccompat.h:93:错误:此范围内未声明'o'
    /tmp/pip-JAGZDD-build/src/pyodbccompat.h:94:错误:在'{'标记之前预期','或';'     /tmp/pip-JAGZDD-build/src/pyodbccompat.h:104:错误:此范围内未声明'PyObject'
    /tmp/pip-JAGZDD-build/src/pyodbccompat.h:104:错误:此范围内未声明'lhs'
    /tmp/pip-JAGZDD-build/src/pyodbccompat.h:104:错误:在'const'之前的预期primary-expression
    /tmp/pip-JAGZDD-build/src/pyodbccompat.h:104:错误:初始化表达式列表被视为复合表达式
    /tmp/pip-JAGZDD-build/src/pyodbccompat.h:109:错误:'Text_Size'声明为'内联'变量
    /tmp/pip-JAGZDD-build/src/pyodbccompat.h:109:错误:此范围内未声明'PyObject'
    /tmp/pip-JAGZDD-build/src/pyodbccompat.h:109:错误:此范围内未声明'o'
    /tmp/pip-JAGZDD-build/src/pyodbccompat.h:110:错误:预期','或';'在'{'标记之前     /tmp/pip-JAGZDD-build/src/pyodbccompat.h:118:错误:'TextCopyToUnicode'声明为'内联'变量
    /tmp/pip-JAGZDD-build/src/pyodbccompat.h:118:错误:此范围内未声明'Py_UNICODE'
    /tmp/pip-JAGZDD-build/src/pyodbccompat.h:118:错误:此范围内未声明'缓冲区'
    /tmp/pip-JAGZDD-build/src/pyodbccompat.h:118:错误:此范围内未声明'PyObject'
    /tmp/pip-JAGZDD-build/src/pyodbccompat.h:118:错误:此范围内未声明“o”
    /tmp/pip-JAGZDD-build/src/pyodbccompat.h:118:错误:初始化表达式列表被视为复合表达式
    /tmp/pip-JAGZDD-build/src/pyodbccompat.h:119:错误:在'{'标记之前预期','或';'     错误:命令' gcc'退出状态1失败

1 个答案:

答案 0 :(得分:0)

决议是重新安装Python2.7