File "_mssql.pxd", line 10, in init pymssql (pymssql.c:12429)

参考文章:
https://github.com/pymssql/pymssql/issues/396
https://github.com/pymssql/pymssql/issues/400
https://github.com/pymssql/pymssql/issues/399
https://stackoverflow.com/questions/36352728/importerror-dll-load-failed-when-trying-to-import-pymssql-on-windows


测试代码:
# -*- coding:utf-8 -*-
import pymssql

conn = pymssql.connect(host='192.168.15.11', port='2250', user='sa', password='123456', database='XXX', charset="utf8")

print conn


错误提示:
C:\Python27>python.exe test.py
Traceback (most recent call last):
  File "test.py", line 2, in <module>
    import pymssql
  File "_mssql.pxd", line 10, in init pymssql (pymssql.c:12429)

ImportError: DLL load failed: 找不到指定的程序。


错误原因:


解决方法:
安装2.1.1版本即可 
pip install "pymssql==2.1.1"
https://pypi.python.org/pypi/pymssql/2.1.1

猜你喜欢

转载自blog.csdn.net/friendan/article/details/78994618