python - “加载 dynlib/dll 失败”在与 PyInstaller 绑定后执行“*.exe”文件时
问题描述
该代码在使用 CMD 执行时成功运行,但是当它*.exe
使用 Pyinstaller 绑定到文件时,它会引发错误并停止执行(消息如下所示)。我通过链接路径库和其他东西尝试了所有可能的解决方案。
MatplotlibDeprecationWarning:
The MATPLOTLIBDATA environment variable was deprecated in Matplotlib 3.1 and will be removed in 3.3.
exec(bytecode, module.__dict__)
Traceback (most recent call last):
File "site-packages\pyinstaller-4.0.dev0-py3.7.egg\PyInstaller\loader\pyiboot01_bootstrap.py", line 167, in __init__
File "ctypes\__init__.py", line 364, in __init__
OSError: [WinError 126] The specified module could not be found
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "try.py", line 2, in <module>
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "C:\Users\Mohammed Hashim\AppData\Local\Programs\Python\Python37\lib\site-packages\pyinstaller-4.0.dev0-py3.7.egg\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\sklearn\__init__.py", line 80, in <module>
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "C:\Users\Mohammed Hashim\AppData\Local\Programs\Python\Python37\lib\site-packages\pyinstaller-4.0.dev0-py3.7.egg\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\sklearn\_distributor_init.py", line 18, in <module>
File "site-packages\pyinstaller-4.0.dev0-py3.7.egg\PyInstaller\loader\pyiboot01_bootstrap.py", line 169, in __init__
__main__.PyInstallerImportError: Failed to load dynlib/dll 'C:\\Users\\MOHAMM~1\\AppData\\Local\\Temp\\_MEI38242\\sklearn\\.libs\\vcomp140.dll'. Most probably this dynlib/dll was not found when the application was frozen.
[13968] Failed to execute script try
以前,它[11496] Failed to execute script try
带有类似的错误消息。
我也特此分享我的代码。(编写此代码是为了检查缺少的库和错误消息 - 方便的错误检测)
import pandas as pd
from sklearn import datasets
data = pd.read_csv(r"D:\PROGRAMS\DATASETS\Kang_nose_data_csv.csv")
print(data.head())
它会为 sklearn、numpy 和 pandas 以及许多其他库产生类似的错误。谢谢...!
解决方案
推荐阅读
- tomcat - tomcat请求转发被禁止
- r - 如何修改函数中的参数?
- keras - 我可以在 Keras Dense Layer 上使用 3D 输入吗?
- reactjs - 使用反应调用 MVC 端点时 Map() 不是函数
- python - 使用无服务器离线启动调试 python 应用程序时出现 Pdb 错误
- unix - 为固定宽度文件计算 Unix 中只有空格的字符串长度
- python - numpy 在作业中做了什么?
- c++ - 一段时间后,Qml chartview 的右侧边框向左移动了一些像素
- javascript - 无法更改数据表的搜索框宽度或位置
- javascript - 在使用 simple-headless-chrome npm 生成的 PDF 中更新并添加可点击链接