【发布时间】:2018-10-07 15:58:55
【问题描述】:
以下是我正在使用的模块列表:
import sys
import cv2
import numpy as np
import pytesseract
from PIL import Image
from sklearn.cluster import MeanShift, estimate_bandwidth
from sklearn.datasets.samples_generator import make_blobs
import re
import jellyfish
异常
Traceback (most recent call last):
File "c:\python\lib\site-packages\matplotlib\backends\backend_webagg.py", line 29, in <module>
import tornado
ModuleNotFoundError: No module named 'tornado'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 12, in <module>
File "c:\python\lib\site-packages\matplotlib\backends\backend_webagg.py", line 31, in <module>
raise RuntimeError("The WebAgg backend requires Tornado.")
运行生成的exe出错:
File "c:\python\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\scipy\sparse\linalg\isolve\iterative.py", line 7, in <module>
File "c:\python\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 714, in load_module
module = loader.load_module(fullname)
ImportError: DLL load failed: The specified module could not be found.
[22724] Failed to execute script main
我已经在 git 链接上尝试了建议的解决方案,但似乎没有任何效果。脚本本身运行良好。我在 Windows 10、Python 3.6 上
【问题讨论】:
-
你试过 cx_Freeze 吗?
-
是的,我试过了,但我认为我无法正确配置 setup.py,它给了我很多错误
-
尝试 python -m pip install tornado 并导入 tornado。
-
新警告:65756 警告:未找到隐藏导入“sklearn.utils.sparsetools._graph_validation”! 65757 警告:未找到隐藏导入“sklearn.utils.sparsetools._graph_tools”!运行生成的 exe 时出现的新错误可能与警告有关: Traceback (最近一次调用最后一次): File "main.py", line 7, in
from sklearn.cluster import MeanShift, estimate_bandwidth File "c:\python\ lib\site-packages\PyInstaller\loader\pyimod03_importers.py",第 631 行,在 exec_module exec(bytecode, module.__dict__) -
我终于可以运行exe了。非常感谢您的 cmets。虽然他们没有直接回答我的问题,但肯定帮助我找到了正确的方向。
标签: python python-3.x pyinstaller py2exe