cx_freeze error with pyodbc

删除回忆录丶 提交于 2019-12-10 15:06:49

问题


if you have a simple program name pyodbcTest.py

import pyodbc
print "pass"

and then use cx_freeze to compile it

cxfreeze --targe-dir=cxTest pyodbcTest.py

and then run that program it throws the following error.

C:\temp\pythonWork\cxTest>pyodbcTest.exe                                                         
Traceback (most recent call last):                                                               
    File "C:\Python27\lib\site-packages\cx_Freeze\initscripts\Console.py", line 27, in <module>     
        exec code in m.__dict__                                                                     
    File "pyodbcTest.py", line 1, in <module>                                           
 RuntimeError: Unable to import decimal       

Any ideas?


回答1:


I had to add the option --include-module decimal to solve the problem. Not sure why it could not find that one on its own during the freeze process, but its working now



来源:https://stackoverflow.com/questions/5638949/cx-freeze-error-with-pyodbc

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!