简体   繁体   English

导入错误:DLL加载失败:使用cxfreeze时找不到指定的模块

[英]Import Error: DLL load failed: The specified module could not be found when using cxfreeze

I've been trying to convert a .py file to a .exe file using pyinstaller (failed, too many modules missing), now I've moved on to cx_freeze, things are running smoother but I'm still unable to compile my script. 我一直在尝试使用pyinstaller将.py文件转换为.exe文件(失败,缺少太多模块),现在我移至cx_freeze,运行情况更加流畅,但是我仍然无法编译我的脚本。 I'm using windows 10, 64 bit if it matters. 我使用的是Windows 10(64位)。 Here is my setup.py 这是我的setup.py

 import sys
from cx_Freeze import setup, Executable

setup(
    name = "EyeBreak",
    version = "3.1",
    description = "Script to remind user of 202020 eye rule.",
    executables = [Executable("EyeBreak.py", base = "Win32")])

I get an error from cmd as follows: 我收到来自cmd的错误,如下所示:

 Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.

C:\Users\fares>cd c:\Python34

c:\Python34>python setup.py build
running build
running build_exe
Traceback (most recent call last):
  File "setup.py", line 8, in <module>
    executables = [Executable("EyeBreak.py", base = "Win32")])
  File "c:\Python34\lib\site-packages\cx_Freeze\dist.py", line 362, in setup
    distutils.core.setup(**attrs)
  File "c:\Python34\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "c:\Python34\lib\distutils\dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "c:\Python34\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "c:\Python34\lib\distutils\command\build.py", line 126, in run
    self.run_command(cmd_name)
  File "c:\Python34\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "c:\Python34\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "c:\Python34\lib\site-packages\cx_Freeze\dist.py", line 231, in run
    metadata = metadata)
  File "c:\Python34\lib\site-packages\cx_Freeze\freezer.py", line 101, in __init__
    for n in self._GetDefaultBinPathExcludes() + binPathExcludes]
  File "c:\Python34\lib\site-packages\cx_Freeze\freezer.py", line 242, in _GetDefaultBinPathExcludes
    **import cx_Freeze.util
ImportError: DLL load failed: The specified module could not be found.**

Check your installation of cx_Freeze for util.pyd. 检查cx_Freeze的安装以获取util.pyd。 From the errors noted above that should be in this location: 根据上面指出的错误,应该在此位置:

c:\\Python34\\lib\\site-packages\\cx_Freeze\\util.pyd c:\\ Python34 \\ lib \\ site-packages \\ cx_Freeze \\ util.pyd

If that isn't found, your installation is broken. 如果找不到该文件,则说明您的安装已损坏。 You can use this command to install a pre-built cx_Freeze instead: 您可以使用以下命令来安装预构建的cx_Freeze:

python -m pip install cx_Freeze --upgrade

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 导入错误:DLL 加载失败。 指定的模块无法找到 - Import Error: DLL load failed. The specified module could not be found Pyinstaller:导入错误:DLL 加载失败:找不到指定的模块 - Pyinstaller: Import Error: DLL load failed: The specified module could not be found 尝试导入 sklearn 模块时出错:ImportError:DLL 加载失败:找不到指定的模块 - Error when trying to import sklearn modules : ImportError: DLL load failed: The specified module could not be found “import torch”给出错误“from torch._C import *, DLL load failed: The specified module could not be found” - "import torch" giving error "from torch._C import *, DLL load failed: The specified module could not be found" 我收到一个导入错误,提示“导入 _path 时 DLL 加载失败:当我运行 matplotlib 时,在 pycharm 中找不到指定的模块 - I receive an import error saying "DLL load failed while importing _path: The specified module could not be found in pycharm when I run matplotlib cx_Freeze导入错误:DLL加载失败:找不到指定的模块 - cx_Freeze Import Error: DLL load failed: The specified module could not be found Tkinter给出导入错误:DLL加载失败:找不到指定的模块 - Tkinter giving Import Error: DLL load failed: The specified module could not be found 无法导入 tflite-support 包。 接收错误“DLL 加载失败:找不到指定的模块” - Unable to Import tflite-support package. Receiving error "DLL load failed: The specified module could not be found" ImportError:DLL加载失败:找不到指定的模块。 尝试“从PIL导入图像”时 - ImportError: DLL load failed: The specified module could not be found. when trying to “from PIL import Image” ver.2 PyGreSQL ERROR: from _pg import * ImportError: DLL load failed: The specified module could not be found - ver.2 PyGreSQL ERROR: from _pg import * ImportError: DLL load failed: The specified module could not be found
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM