简体   繁体   English

在Fedora上安装pyodbc-3.0.6时出错

[英]Error when installing pyodbc-3.0.6 on Fedora

I am trying to install pyodbc-3.0.6 on Fedora. 我想在Fedora上安装pyodbc-3.0.6。

I had downloaded it from here 我从这里下载了它

When I run it with python setup.py install it's displaying the following error 当我使用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

Can anyone let me know how to solve this. 任何人都可以让我知道如何解决这个问题。

Edited Code: 编辑代码:

After installing g++ as indicated by below command and when I run the following command 按照以下命令安装g ++并运行以下命令后

python setup.py install

from inside the pyodbc downloaded folder I got the following error 从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

You need to install g++ package. 你需要安装g ++包。 yum install compat-gcc-34-c++ (edit: it seems they moved it to compat-gcc-34-c++ ) yum install compat-gcc-34-c++ (编辑:看来他们把它移到了compat-gcc-34-c++

[edit] [编辑]

For the second issue - you are missing unixODBC-devel package. 对于第二个问题 - 您缺少unixODBC-devel包。

For CentOS the package name is gcc-c++ 对于CentOS,包名称是gcc-c++

To suppress the exception: 要取消异常:

sql.h: No file or directory in CentOS install unixODBC-devel.x86_64 sql.h:CentOS中没有文件或目录安装unixODBC-devel.x86_64

Run the following command for 64-bit: 对64位运行以下命令:

yum install unixODBC-devel.x86_64

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM