4

我正在尝试在 Fedora 上安装 pyodbc-3.0.6。

我已经从这里下载了

当我运行它时python setup.py install显示以下错误

running install
running bdist_egg
running egg_info
writing pyodbc.egg-info/PKG-INFO
writing top-level names to pyodbc.egg-info/top_level.txt
writing dependency_links to pyodbc.egg-info/dependency_links.txt
writing pyodbc.egg-info/PKG-INFO
writing top-level names to pyodbc.egg-info/top_level.txt
writing dependency_links to pyodbc.egg-info/dependency_links.txt
reading manifest file 'pyodbc.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'tests/*'
writing manifest file 'pyodbc.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_ext
building 'pyodbc' extension
creating build
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/home
creating build/temp.linux-x86_64-2.7/home/local
creating build/temp.linux-x86_64-2.7/home/local/PENNYWISE
creating build/temp.linux-x86_64-2.7/home/local/PENNYWISE/shivakrishnab
creating build/temp.linux-x86_64-2.7/home/local/PENNYWISE/shivakrishnab/Desktop
creating build/temp.linux-x86_64-2.7/home/local/PENNYWISE/shivakrishnab/Desktop/pyodbc-3.0.6
creating build/temp.linux-x86_64-2.7/home/local/PENNYWISE/shivakrishnab/Desktop/pyodbc-3.0.6/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.6 -I/usr/include/python2.7 -c /home/local/user/Desktop/pyodbc-3.0.6/src/buffer.cpp -o build/temp.linux-x86_64-2.7/home/local/user/Desktop/pyodbc-3.0.6/src/buffer.o -Wno-write-strings
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
error: command 'gcc' failed with exit status 1

谁能让我知道如何解决这个问题。

编辑代码:

按照以下命令指示安装 g++ 后,当我运行以下命令时

python setup.py install

从 pyodbc 下载的文件夹中,我收到以下错误

installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_ext
building 'pyodbc' 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 -DPYODBC_VERSION=3.0.6 -I/usr/include/python2.7 -c /home/local/user/Desktop/pyodbc-3.0.6/src/buffer.cpp -o build/temp.linux-x86_64-2.7/home/local/user/Desktop/pyodbc-3.0.6/src/buffer.o -Wno-write-strings
In file included from /home/local/user/Desktop/pyodbc-3.0.6/src/buffer.cpp:12:0:
/home/local/user/Desktop/pyodbc-3.0.6/src/pyodbc.h:48:17: fatal error: sql.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
4

2 回答 2

4

您需要安装 g++ 包。yum install compat-gcc-34-c++ (编辑:似乎他们把它移到了compat-gcc-34-c++

[编辑]

对于第二个问题-您缺少unixODBC-devel包。

对于 CentOS,软件包名称是gcc-c++

于 2012-08-08T12:01:30.980 回答
0

要抑制异常:

sql.h:CentOS 中没有文件或目录安装 unixODBC-devel.x86_64

对 64 位运行以下命令:

yum install unixODBC-devel.x86_64
于 2014-08-11T05:31:05.713 回答