Python 3.3.4 Cx_Freeze ImportError: DDL load failed: The specified module could not be found

£可爱£侵袭症+ 提交于 2019-12-10 20:03:03

问题


I am attempting to use cx_Freeze to turn a .py file that I wrote in Python 3.3.4. In running the build command, I get the following error.

C:\Python33>c:\python33\python.exe setup.py build
running build
running build_exe
Traceback (most recent call last):
  File "setup.py", line 22, in <module>
    executables=executables
  File "c:\python33\lib\site-packages\cx_Freeze\dist.py", line 365, in setup
    distutils.core.setup(**attrs)
  File "c:\python33\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\python33\lib\distutils\dist.py", line 930, in run_commands
self.run_command(cmd)
  File "c:\python33\lib\distutils\dist.py", line 949, in run_command
cmd_obj.run()
  File "c:\python33\lib\distutils\command\build.py", line 126, in run
self.run_command(cmd_name)
  File "c:\python33\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\python33\lib\distutils\dist.py", line 949, in run_command
cmd_obj.run()
File "c:\python33\lib\site-packages\cx_Freeze\dist.py", line 234, in run
metadata = metadata)
File "c:\python33\lib\site-packages\cx_Freeze\freezer.py", line 101, in __init
__
for n in self._GetDefaultBinPathExcludes() + binPathExcludes]
File "c:\python33\lib\site-packages\cx_Freeze\freezer.py", line 235, in _GetDe
faultBinPathExcludes
import cx_Freeze.util
ImportError: DLL load failed: The specified module could not be found.

Have I not installed cx_freeze correctly? Or am I running it all wrong? Help is greatly appreciated. Thanks


回答1:


Well, I found an answer that works for me.

Turns out there's a bug in cx_Freeze 4.3.4 and downgrading to 4.3.3 solved this problem for me.




回答2:


Try opening up the util.pyd file with a tool like Dependency Walker in order to check if the error is a result of missing dependencies. I found that it was trying to load msvcr100.dll from the Microsoft Visual C++ 2010 runtime which I did not have installed on my machine. If this is also the source of your error, you can try running the x86 / x64 installer to see if this addresses it (you want to pick the one that matches the architecture of your Python installation not of your OS).



来源:https://stackoverflow.com/questions/21949214/python-3-3-4-cx-freeze-importerror-ddl-load-failed-the-specified-module-could

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