小编var*_*ela的帖子

pymssql 抛出 ImportError: 使用 py2exe 构建应用程序时没有名为 _mssql 的模块

我有 python 应用程序应该作为 Windows 可执行文件启动。我正在使用 py2exe 和 pymssql 1.9.908。

我使用下一个构建脚本来生成应用程序:

from distutils.core import setup
import MySQLdb
import fnmatch
import os
import pymssql
import shutil
import py2exe
import glob

##############

name = 'BGAgent'
old_version = '0.1'
ver = '0.1'

distDir = 'Dist' + name + ver
shutil.rmtree(distDir, True)
shutil.rmtree('Dist' + name + old_version, True)

os.mkdir(distDir)

##############

class Target(object):
    """ A simple class that holds information on our executable file. """
    def __init__(self, **kw):
        """ Default class constructor. Update as you need. …
Run Code Online (Sandbox Code Playgroud)

python py2exe pymssql

5
推荐指数
1
解决办法
2万
查看次数

标签 统计

py2exe ×1

pymssql ×1

python ×1