1

I am trying to create an executable from a standard skimage demo script listed here:

import matplotlib.pyplot as plt

from skimage import data
from skimage.morphology import disk
from skimage.filters import rank


image = data.coins()
selem = disk(20)

percentile_result = rank.mean_percentile(image, selem=selem, p0=.1, p1=.9)
bilateral_result = rank.mean_bilateral(image, selem=selem, s0=500, s1=500)
normal_result = rank.mean(image, selem=selem)

fig, axes = plt.subplots(nrows=2, ncols=2, figsize=(10, 10),
                         sharex=True, sharey=True)
ax = axes.ravel()

titles = ['Original', 'Percentile mean', 'Bilateral mean', 'Local mean']
imgs = [image, percentile_result, bilateral_result, normal_result]
for n in range(0, len(imgs)):
    ax[n].imshow(imgs[n], cmap=plt.cm.gray)
    ax[n].set_title(titles[n])
    ax[n].set_adjustable('box-forced')
    ax[n].axis('off')

plt.tight_layout()
plt.show()

The command would be pyinstaller -F test.py

The first problem, reaching the recursion depth limit, can be solved by increasing the recursion depth limit as described here.

After doing so, I get a valid *.exe file, but the warning file contains 80 kb of missing modules, and aborts on execution with "No module named _cwt".

Including _cwt in hiddenimports as described here does not work.

Any ideas what to try next?

[Edit]

  • I have tried both Win7 and Win 10 environments, am working with python 2.7 and pyinstaller 3.3
  • some warning messages from warnBVLibrary.txt

    missing module named fcntl - imported by tempfile, subprocess, tornado.platform.posix, paramiko.agent, zmq.eventloop.minitornado.platform.posix, backports.shutil_get_terminal_size.get_terminal_size, IPython.utils._get_terminal_size, prompt_toolkit.terminal.vt100_output, prompt_toolkit.eventloop.posix, gevent.os, gevent.fileobject, gevent.subprocess, py._io.terminalwriter missing module named org - imported by copy missing module named startup - imported by pyreadline.keysyms.common, pyreadline.keysyms.keysyms missing module named System - imported by pyreadline.console.ironpython_console, pyreadline.keysyms.ironpython_keysyms, pyreadline.rlmain, traitlets.traitlets, IPython.utils._process_cli missing module named pwd - imported by posixpath, getpass, pathlib, shutil, tarfile, distutils.util, pathlib2, netrc, webbrowser, distutils.archive_util, py._path.local missing module named _scproxy - imported by urllib, future.backports.urllib.request missing module named EasyDialogs - imported by getpass missing module named termios - imported by getpass, tty, backports.shutil_get_terminal_size.get_terminal_size, IPython.utils._get_terminal_size, prompt_toolkit.terminal.vt100_output, prompt_toolkit.terminal.vt100_input, IPython.core.page, py._io.terminalwriter missing module named SOCKS - imported by ftplib missing module named rourl2path - imported by urllib missing module named IronPythonConsole - imported by pyreadline.console.ironpython_console missing module named clr - imported by pyreadline.console.ironpython_console, pyreadline.clipboard.ironpython_clipboard, nose.suite, IPython.utils._process_cli missing module named 'System.Windows' - imported by pyreadline.clipboard.ironpython_clipboard missing module named vms_lib - imported by platform missing module named 'org.python' - imported by pickle, xml.sax, setuptools.sandbox missing module named 'java.lang' - imported by platform, xml.sax._exceptions missing module named java - imported by platform, mock missing module named _xmlplus - imported by xml missing module named 'Carbon.File' - imported by plistlib missing module named 'Carbon.Files' - imported by plistlib missing module named Carbon - imported by plistlib missing module named MacOS - imported by platform missing module named macresource - imported by MacOS missing module named gestalt - imported by platform

tfv
  • 6,016
  • 4
  • 36
  • 67
  • are you on windows 10? are you up to date on pyinstaller? what python are you running? – The4thIceman Oct 23 '17 at 16:33
  • Also, can you post some of the applicable warnings (no need for all of them) – The4thIceman Oct 23 '17 at 16:49
  • @The4thlceman: I have edited the post above. – tfv Oct 23 '17 at 19:07
  • Is Skimage in your local working directory? or in your path? also what exactly did you put (your command) for the hidden import? – The4thIceman Oct 23 '17 at 19:12
  • I have not put anything into hidden import (since this would be 80 kb of module names), and skimage is not in my local working directory or path (I want to create one single exe file for distribution. Seems that you say that this will not work or get huge? – tfv Oct 23 '17 at 20:07
  • 1
    Basically, pyinstaller is not grabbing the proper stuff, so you need to make sure what it needs is in the working directory, or as a hidden import. If you try this and it works, then at least you know that was the issues. If it doesn't work, then something else is going on. You should be able to just add skimage as a hidden import and pyinstaller should find the rest – The4thIceman Oct 23 '17 at 20:11
  • I think I got the idea. I included skimage, but the warning log is still showing numpy, matplotlib and loads of other modules in 90 kb, and I'd have to include all those. My exe is already at 150 MB with skimage only, so the file would be huge and the process long. Thanks anyway. – tfv Oct 23 '17 at 20:58
  • I have the same problem, Have you solved it? – Misam Mehmannavaz Sep 08 '19 at 15:31

0 Answers0