简体   繁体   English

mac os x 山狮 10.9.2 上的 pymssql

[英]pymssql on mac os x mountain lion 10.9.2

Recently discovered pymssql and got it working on a windows machine (python 3.4).最近发现了 pymssql 并让它在 Windows 机器上运行(python 3.4)。 However when I try to run the script on my mac (10.9.2), I get an error when I 'import pymssql'.但是,当我尝试在我的 mac (10.9.2) 上运行脚本时,我在“导入 pymssql”时收到错误消息。 Note both on the windows box and on the mac, I installed via 'pip3.4 install pymssql'.请注意在 Windows 和 Mac 上,我都是通过“pip3.4 install pymssql”安装的。 Installation concluded with no errors in both cases.在这两种情况下,安装都没有错误。

This is what I get when I try to import pymssql on the mac :这是我尝试在 mac 上导入 pymssql 时得到的结果:

Python 3.4.0 (v3.4.0:04f714765c13, Mar 15 2014, 23:02:41) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. Python 3.4.0 (v3.4.0:04f714765c13, Mar 15 2014, 23:02:41) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin 键入“help”、“copyright”、“学分”或“许可证”以获取更多信息。

import pymssql Traceback (most recent call last): File "", line 1, in ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pymssql.so, 2): Library not loaded: /usr/local/lib/libsybdb.5.dylib Referenced from: /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pymssql.so Reason: image not found导入 pymssql 回溯(最近一次调用最后一次):文件“”,第 1 行,在 ImportError 中:dlopen(/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pymssql.so, 2 ):库未加载:/usr/local/lib/libsybdb.5.dylib 引用自:/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pymssql.so 原因:图像未找到

Note pip3.4 search pymssql results in : pymssql - DB-API interface to Microsoft SQL Server for Python.注意 pip3.4 搜索 pymssql 结果:pymssql - Microsoft SQL Server for Python 的 DB-API 接口。 (new Cython-based version) INSTALLED: 2.1.0 (latest) (基于 Cython 的新版本)已安装:2.1.0(最新)

Note further that /usr/local/lib/libsybdb.5.dylib does NOT exist, but then again, I couldn't find in on the windows box either (searched the C drive for libsybdb)进一步注意 /usr/local/lib/libsybdb.5.dylib 不存在,但话又说回来,我也无法在 Windows 框中找到(在 C 驱动器中搜索 libsybdb)

How do I get around this?我该如何解决这个问题?

您需要安装 freetds 库才能与 Microsoft SQL Server 通信

brew install freetds

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

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