cx_Freeze help. ImportError

让人想犯罪 __ 提交于 2019-12-24 11:50:40

问题


I'm a newbie to cx_Freeze and I need some help. I'm writing an application with python 3.3, pyqt4 and some more libraries (scipy, numpy, matplotlib, dxfwrite). Now I'm trying to freeze the application with cx_Freeze under windows7. I'm using cx_Freeze-4.3.2.win-amd64-py3.3 and the following setup.py for cx_Freeze:

import sys
from cx_Freeze import setup, Executable

build_exe_options = {"packages": ["os"], "excludes": ["tkinter"] }

setup(
    name = "Barrel Cam Editor",
    version = "0.2.0",
    description = "An editor for Barrel Cams",
    options = {"build_exe": build_exe_options},
    executables = [Executable("barrelcameditor.py", base = "Win32GUI")])

I run the command python setup.py build and it seems to work but when I launch the obtained exe I get an Importerror: DLL load failed. I really do not know how to solve this problem. any help? Tnx

PS: Thank you for your help, it was a problem with scipy.linalg. I switched to numpy.linalg and it seems to work. Now I've another little problem: I was importing a custom package:

from barrelcam import camdata, camdlg, camwidget

but in this way it is not working. I found a workaround: I moved the files to the barrelcameditor folder and it seems to work, changing the import to

import camdata, camdlg, camwidget

There is a way to keep the original position of files?

Thank you

来源:https://stackoverflow.com/questions/22093417/cx-freeze-help-importerror

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