首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在19.10上安装unixodbc

在19.10上安装unixodbc
EN

Ask Ubuntu用户
提问于 2019-10-23 07:07:36
回答 1查看 16.4K关注 0票数 5

我试图使用pyodbc连接到python中的MSSQL数据库。我已经按照使用19.04版本的这里指令安装了MS驱动程序。当试图通过pip安装pyodbc时,我得到了sql.h: No such file or directory。谷歌告诉我,我需要安装unixodbcunixodbc-dev,但是,当我尝试这样做时,我会得到以下信息:

代码语言:javascript
复制
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自动清洗,apt安装-f等没有做任何事情。

EN

回答 1

Ask Ubuntu用户

回答已采纳

发布于 2019-10-23 15:02:11

看来,在19.10上的unixODBC驱动程序中存在一个问题(具体来说,驱动程序提供的unixODBC的依赖项之一依赖于multiarch-support,它存在于所有其他Ubuntus,而不是19.10)。

要了解这一点,您可以从http://www.unixodbc.org/下载包(请参阅右侧的下载按钮),然后按照说明手动安装它。或者通过执行以下操作来安装Ubuntu中的默认unixODBC:

代码语言:javascript
复制
#delete the package info, so that apt doesn't try to use that version of unixODBC
sudo rm /etc/apt/sources.list.d/mssql-release.list

#install the default one
sudo apt install unixodbc

#re-add the package and install the driver
sudo su
curl https://packages.microsoft.com/config/ubuntu/19.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
exit
sudo apt install msodbcsql17
票数 6
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1183140

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档