参考文章:
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")
错误提示:
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)
解决方法:
安装2.1.1版本即可
pip install "pymssql==2.1.1"
https://pypi.python.org/pypi/pymssql/2.1.1
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