成功解决module = loader.load_module(fullname) ImportError: DLL load failed: 找不到指定的模块。

简介: 成功解决module = loader.load_module(fullname) ImportError: DLL load failed: 找不到指定的模块。

解决问题


module = loader.load_module(fullname)ImportError: DLL load failed: 找不到指定的模块。


Traceback (most recent call last):

 File "CV Detection Smiling Sex bakup\CV_Object.py", line 205, in on_pushButton_9_clicked

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "CV Detection Smiling Sex bakup\utils\datasets.py", line 1, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "scipy\io\__init__.py", line 97, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "scipy\io\matlab\__init__.py", line 13, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "scipy\io\matlab\mio.py", line 12, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "scipy\io\matlab\miobase.py", line 22, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "scipy\misc\__init__.py", line 68, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "scipy\interpolate\__init__.py", line 175, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "scipy\interpolate\interpolate.py", line 20, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "scipy\linalg\__init__.py", line 190, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "scipy\linalg\misc.py", line 5, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "scipy\linalg\blas.py", line 214, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 714, in load_module

   module = loader.load_module(fullname)

ImportError: DLL load failed: 找不到指定的模块。

有的网友说需要更新pillow库,pip install pillow

image.png





解决方法


T1、搜索路径


找了下是路径不对,指定搜索路径就好了,如下

pyinstaller --path C:\Users\leon\AppData\Local\Programs\Python\Python35\Lib\site-packages\PyQt5\Qt\bin -F name.py

pyinstaller --path F:\Program Files\Python\Python36\Lib\site-packages\PyQt5\Qt\bin -F CV_Object.py


T2、放在前边


将调用的自定义的函数文件放在最前边,而不是放在按钮命令下,比如


image.png



T3、找到出错的位置继续更新库

image.png




Traceback (most recent call last):

 File "CV Detection Smiling Sex bakup\CV_Object.py", line 23, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "CV Detection Smiling Sex bakup\yolo.py", line 13, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "site-packages\keras\__init__.py", line 7, in <module>

   from . import datasets

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "site-packages\keras\datasets\__init__.py", line 4, in <module>

   from . import activations

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "site-packages\keras\datasets\imdb.py", line 8, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "site-packages\keras\preprocessing\__init__.py", line 12, in <module>

   from . import callbacks

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "site-packages\keras\preprocessing\image.py", line 7, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "site-packages\keras_preprocessing\image.py", line 9, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "site-packages\scipy\linalg\__init__.py", line 186, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "site-packages\scipy\linalg\misc.py", line 5, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "site-packages\scipy\linalg\blas.py", line 196, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 714, in load_module

   module = loader.load_module(fullname)

ImportError: DLL load failed: 找不到指定的模块。

[18756] Failed to execute script CV_Object

Traceback (most recent call last):

 File "CV Detection Smiling Sex bakup\CV_Object.py", line 34, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "CV Detection Smiling Sex bakup\utils.py", line 5, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "site-packages\keras\__init__.py", line 7, in <module>

   from . import datasets

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "site-packages\keras\datasets\__init__.py", line 4, in <module>

   from . import activations

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "site-packages\keras\datasets\imdb.py", line 8, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "site-packages\keras\preprocessing\__init__.py", line 12, in <module>

   from . import callbacks

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "site-packages\keras\preprocessing\image.py", line 7, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "site-packages\keras_preprocessing\image.py", line 9, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "site-packages\scipy\linalg\__init__.py", line 186, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "site-packages\scipy\linalg\misc.py", line 5, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "site-packages\scipy\linalg\blas.py", line 196, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 714, in load_module

   module = loader.load_module(fullname)

ImportError: DLL load failed: 找不到指定的模块。

[29928] Failed to execute script CV_Object

T4、问题原因numpy没找到支持blas的库


(1)先下载numpy+mkl

(2)并添加到环境变量里面

image.png


Traceback (most recent call last):

 File "CV Detection Smiling Sex no voice\CV_Object.py", line 21, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "CV Detection Smiling Sex no voice\yolo.py", line 13, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "site-packages\keras\__init__.py", line 7, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "site-packages\keras\datasets\__init__.py", line 4, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "site-packages\keras\datasets\imdb.py", line 8, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "site-packages\keras\preprocessing\__init__.py", line 12, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "site-packages\keras\preprocessing\image.py", line 7, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "site-packages\keras_preprocessing\image.py", line 9, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "site-packages\scipy\linalg\__init__.py", line 190, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "site-packages\scipy\linalg\misc.py", line 5, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "site-packages\scipy\linalg\blas.py", line 214, in <module>

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 714, in load_module

   module = loader.load_module(fullname)

ImportError: DLL load failed: 找不到指定的模块。

[8496] Failed to execute script CV_Object

T5、将缺少的dll文件赋值到exe所在文件夹


image.png


大功告成!


相关文章
|
8月前
|
Ubuntu Python
【Python】报错ModuleNotFoundError: No module named ‘XXX‘
【Python】报错ModuleNotFoundError: No module named ‘XXX‘
|
8月前
报错/ ./node_modules/axios/lib/platform/index.js Module parse failed: Unexpected token (5:2)怎么解决?
报错/ ./node_modules/axios/lib/platform/index.js Module parse failed: Unexpected token (5:2)怎么解决?
|
8月前
|
机器学习/深度学习 并行计算 安全
ImportError: DLL load failed while importing libpaddle: 找不到指定的模块。问题处理
【5月更文挑战第12天】ImportError: DLL load failed while importing libpaddle: 找不到指定的模块。问题处理
2580 0
pip安装skbuild报错:ModuleNotFoundError: No module named ‘skbuild’解决方法
pip安装skbuild报错:ModuleNotFoundError: No module named ‘skbuild’解决方法,换源
777 0
|
异构计算
ModuleNotFoundError: No module named ‘mmcv._ext‘
最近想将mmsegmentation打包成exe进行使用,但是遇到了一个问题,在打包的过程中不会显示报错信息,但是在执行exe程序之后,exe会出现ModuleNotFoundError: No module named 'mmcv._ext'的报错,导致软件崩溃。
1074 0
|
Python
Python3 多线程问题:ModuleNotFoundError: No module named 'thread',原因及解决办法。
Python3 多线程问题:ModuleNotFoundError: No module named 'thread',原因及解决办法。
1155 0
|
TensorFlow 算法框架/工具 Python
成功解决ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'
成功解决ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'
|
网络安全 Python Windows
ImportError: DLL load failed while importing _ssl: 找不到指定的模块。
找到Anaconda3\pkgs\python-3.8.12-h900ac77_2_cpython\DLLs下的_ssl.pyd文件,查阅在该环境上安装的python版本号,下载python寻找对应的_ssl.pyd覆盖到上述目录中,即可解决问题。
1084 0
|
Linux
原因及解决办法:Failed to load module “canberra-gtk-module“
原因及解决办法:Failed to load module “canberra-gtk-module“
1026 0
|
Python
解决办法:ImportError: No module named pycuda.driver
解决办法:ImportError: No module named pycuda.driver
322 0

热门文章

最新文章