使用pycharm生成的exe文件闪退,求解!

这是打包之后的闪退之后的报错问题

Traceback (most recent call last):
File “mainsql.py”, line 1, in
import pymssql
File “src_mssql.pxd”, line 10, in init pymssql
File “src_mssql.pyx”, line 52, in init _mssql
ModuleNotFoundError: No module named ‘decimal’
[276112] Failed to execute script mainsql

源码复制到下面请看一下!
import pymssql

while True:
car = input(‘请输入一个车牌号码:’)
server = ‘192.168.0.167:1433’
user = ‘sa’
password = ‘admin’
database = ‘JQCDB’
charset = “utf8”
#数据库远程连接
conn = pymssql.connect(server, user, password, database)

# 使用cursor()方法获取操作游标
cursor = conn.cursor()
sql = 'select * from [dbo].[dba_reg] '

try:
    cursor.execute(sql)  # 游标
    result = cursor.fetchall()  # 查询

    for row in result:
        #reg_lic = row[2]
        #reg_date = row[3]
        #if car != None:
        if car == row[2]:
            print('车牌号码为:%s,经过摄像机时间为%s' % (row[2], row[3]))

        #else:
            #print('请输入车牌!')

except:
    print("连接数据库报错了!")
b = input('是否继续输入,n退出,任意键继续:')
if b == 'n':
    break
# 关闭数据库连接
conn.close()

你可能感兴趣的:(使用pycharm生成的exe文件闪退,求解!)