我正在尝试使用 pyodbc 连接到 python 中的 MSSQL 数据库。我已经按照此处的说明使用 19.04 版本安装了 MS 驱动程序。尝试通过 pip 安装 pyodbc 时,我得到sql.h: No such file or directory
. 谷歌搜索告诉我我需要安装unixodbc
and unixodbc-dev
,但是当我尝试这样做时,我收到以下消息:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
unixodbc : Depends: odbcinst1debian2 (>= 2.3.7) but it is not going to be installed
Depends: libodbc1 (>= 2.3.7) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
运行 apt autoclean、apt install -f 等没有做任何事情。