开发者

exe created by py2exe give error

开发者 https://www.devze.com 2022-12-25 09:01 出处:网络
i have created an exe from py2exe. After successfully creating the exe, i开发者_高级运维 got the following error when i run main.exe.

i have created an exe from py2exe. After successfully creating the exe, i开发者_高级运维 got the following error when i run main.exe.

  File "_mssql.pyc", line 12, in <module>
  File "_mssql.pyc", line 10, in __load
ImportError: DLL load failed: The specified module could not be found.

I am using pymssql module for sql server.


make sure you include the module under the options dictionary. I think it also needs a dll file called ntwdblib.dll. you can find that file and include it into your setup.py.

import os, pymssql
from distutils.core import setup
import py2exe
dll = []
dll.append(os.path.join(os.path.split(pymssql.__file__)[0], 'ntwdblib.dll'))
pyops = {"includes": ['decimal']}
setup(console=['app.py'], options={"py2exe": pyops}, data_files=dll)
0

精彩评论

暂无评论...
验证码 换一张
取 消