OS系统 python 安装pyodbc模块问题

来源:互联网 发布:framecheck是什么软件 编辑:程序博客网 时间:2024/04/28 17:15

链接conn1=pyodbc.connect("DRIVER={SQL Server};SERVER=localhost,9944;DATABASE=feptrade;UID=crawl2;PWD=crawl")


利用 sudo pip install pyodbc


调用报错

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

ImportError: dlopen(/Library/Python/2.7/site-packages/pyodbc.so, 2): Library not loaded: /usr/local/lib/libodbc.2.dylib

  Referenced from: /Library/Python/2.7/site-packages/pyodbc.so

  Reason: image not found


解决方法:

you should install unixodbc on your system.

#brew install unixodbc                                                                                                ==> Downloading https://homebrew.bintray.com/bottles/unixodbc-2.3.2_1.el_capitan.bottle.1.tar.gz######################################################################## 100.0%==> Pouring unixodbc-2.3.2_1.el_capitan.bottle.1.tar.gz��  /usr/local/Cellar/unixodbc/2.3.2_1: 31 files, 1020K#ipython                                                                                                                Python 2.7.11 (default, Dec  5 2015, 14:44:53)Type "copyright", "credits" or "license" for more information.IPython 4.0.1 -- An enhanced Interactive Python.?         -> Introduction and overview of IPython's features.%quickref -> Quick reference.help      -> Python's own help system.object?   -> Details about 'object', use 'object??' for extra details.In [1]: import pyodbc

安装命令: brew install unixodbc

0 0