无法在 Linux 上安装 pyodbc [英] Unable to install pyodbc on Linux
问题描述
我正在运行 Linux (2.6.18-164.15.1.el5.centos.plus) 并尝试安装 pyodbc.我正在做 pip install pyodbc 并得到一个很长的错误列表,以
I am running Linux (2.6.18-164.15.1.el5.centos.plus) and trying to install pyodbc. I am doing pip install pyodbc and get a very long list of errors, which end in
错误:命令gcc"失败,退出状态为 1
error: command 'gcc' failed with exit status 1
我查看了 /root/.pip/pip.log 并看到以下内容:
I looked in /root/.pip/pip.log and saw the following:
InstallationError: Command/usr/local/bin/python -c "import setuptools; file='/home/build/pyodbc/setup.py'; execfile('/home/build/pyodbc/setup.py')" install --single-version-externally-managed --record/tmp/pip-7MS9Vu-record/install-record.txt 失败,错误代码为 1
InstallationError: Command /usr/local/bin/python -c "import setuptools; file='/home/build/pyodbc/setup.py'; execfile('/home/build/pyodbc/setup.py')" install --single-version-externally-managed --record /tmp/pip-7MS9Vu-record/install-record.txt failed with error code 1
有人在安装 pyodbc 时遇到过类似的问题吗?
Has anybody had a similar issue installing pyodbc?
推荐答案
我按照 pyodbc - Building wiki 其中指出:
在 Linux 上,pyodbc 通常是使用 unixODBC 头文件构建的,因此您需要安装 unixODBC 及其头文件.在 RedHat/CentOS/Fedora 机器上,这意味着您需要安装 unixODBC-devel:
On Linux, pyodbc is typically built using the unixODBC headers, so you will need unixODBC and its headers installed. On a RedHat/CentOS/Fedora box, this means you would need to install unixODBC-devel:
yum install unixODBC-devel
这篇关于无法在 Linux 上安装 pyodbc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!