1

Following is the list of modules I am using:

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

Exception

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.")

Error on running the generated 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

I have tried the suggested solutions on git links but nothing seems to work. The script itself runs fine. Iam on Windows 10, Python 3.6

  • have you tried with cx_Freeze? – diegoiva Apr 26 '18 at 20:56
  • Yes, I tried but I believe I couldn't configure the setup.py properly and it gave me host of errors – stackUnderflow Apr 26 '18 at 20:58
  • try python -m pip install tornado and importing tornado. – diegoiva Apr 26 '18 at 21:18
  • New warnings : 65756 WARNING: Hidden import "sklearn.utils.sparsetools._graph_validation" not found! 65757 WARNING: Hidden import "sklearn.utils.sparsetools._graph_tools" not found! And new errors on running generated exe probably related to the warnings: Traceback (most recent call last): File "main.py", line 7, in from sklearn.cluster import MeanShift, estimate_bandwidth File "c:\python\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module exec(bytecode, module.__dict__) – stackUnderflow Apr 26 '18 at 21:26
  • do you got multiple python interpreters installed? – diegoiva Apr 26 '18 at 21:28
  • I just have python 3.6 – stackUnderflow Apr 26 '18 at 21:28
  • try copying python's dlls tcl and tck to the folder. – diegoiva Apr 26 '18 at 21:32
  • The error which I got now is : File "main.py", line 7, in from sklearn.cluster import MeanShift, estimate_bandwidth File "c:\python\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module exec(bytecode, module.__dict__) File "site-packages\sklearn\__init__.py", line 134, in File "c:\python\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module – stackUnderflow Apr 26 '18 at 21:38
  • 1
    I am finally able to run the exe. Thanks a lot for your comments. Though they did not answer my issue directly , but for sure helped me to search in right direction. – stackUnderflow Apr 27 '18 at 07:03

1 Answers1

1

I was able to finally resolve the issue by following:

  1. Installing and install tornado and importing tornado as pointed by Diego Contreras in comments
  2. Following the steps mentioned in the post [How do you resolve 'hidden imports not found!' warnings in pyinstaller for scipy?

Make sure your Microsoft build tools are installed and the dll location is present in PATH(both x86 and x64). Restart the machine after editing PATH variables.