I am trying to develop an application using the following flow:
- GUI made in Qt Designer using Qt 5.6.2
- Conversion of the GUI file (extension .ui) to py using pyuic5
- Transfer of the code in Spyder and adding a few loops in the recently converted .py file. Note: the code works fine in spyder 3.1.4 and there are no errors. The gui appears and fullfils the necessary functions.
Compilation using cx.freeze 5.0.2
4.1 Creation of the setup.py file as shown below (but tried also other versions found on the internet):
from cx_Freeze import setup, Executable
setup(name = "vsc.py" , version = "0.1" , description = "" , executables = [Executable("vsc.py")])
4.2 run in cmd: python setup.py build (using the right directory and both files vsc.py and setup.py in same directory)
4.3 build folder crated with lots of files in it (including vsc.exe) but this one is not running.
Errors I get for teh step 4.2:
Missing modules:
? IronPython.Runtime.Exceptions imported from nose.suite
? StringIO imported from numpy.lib.utils, numpy.testing.utils
? __builtin__ imported from numpy, numpy.core.numeric, numpy.core.numerictypes,
numpy.distutils.misc_util, numpy.lib._iotools, numpy.lib.function_base, numpy.ma
.core
? __main__ imported from bdb, pdb, rlcompleter
? _curses imported from curses, curses.has_key
? _dummy_threading imported from dummy_threading
? _frozen_importlib imported from importlib, importlib.abc
? _frozen_importlib_external imported from importlib, importlib._bootstrap, impo
rtlib.abc
? _posixsubprocess imported from multiprocessing.util, subprocess
? _scproxy imported from urllib.request
? _winreg imported from numpy.distutils.cpuinfo, platform
? anaconda_decrypt imported from site
? cPickle imported from numpy.core.numeric, numpy.lib.npyio, numpy.ma.core
? clr imported from nose.suite
? commands imported from numpy.distutils.cpuinfo
? compiler.consts imported from nose.pyversion
? copy_reg imported from numpy.core
? future_builtins imported from numpy.lib.npyio
? grp imported from distutils.archive_util, pathlib, shutil, tarfile
? java.lang imported from platform
? multiprocessing.AuthenticationError imported from multiprocessing.connection
? multiprocessing.BufferTooShort imported from multiprocessing.connection
? multiprocessing.Manager imported from nose.plugins.plugintest
? multiprocessing.SimpleQueue imported from concurrent.futures.process
? multiprocessing.TimeoutError imported from multiprocessing.pool
? multiprocessing.current_process imported from nose.plugins.plugintest
? multiprocessing.get_context imported from multiprocessing.managers, multiproce
ssing.pool, multiprocessing.sharedctypes
? multiprocessing.get_start_method imported from multiprocessing.spawn
? multiprocessing.set_start_method imported from multiprocessing.spawn
? new imported from nose.ext.dtcompat, nose.pyversion
? numarray imported from numpy.distutils.system_info
? numpy.core.float32 imported from numpy.testing.utils
? numpy.core.geterrobj imported from numpy.linalg.linalg
? numpy.core.integer imported from numpy.fft.helper
? numpy.core.intp imported from numpy.linalg.linalg
? numpy.core.longdouble imported from numpy.linalg.linalg
? numpy.core.object_ imported from numpy.linalg.linalg
? numpy.core.signbit imported from numpy.testing.utils
? numpy_distutils imported from numpy.f2py.diagnose
? numpy_distutils.command.build_flib imported from numpy.f2py.diagnose
? numpy_distutils.command.cpuinfo imported from numpy.f2py.diagnose
? numpy_distutils.cpuinfo imported from numpy.f2py.diagnose
? numpy_distutils.fcompiler imported from numpy.f2py.diagnose
? org.python.core imported from copy, pickle
? os.path imported from distutils.file_util, numpy.core.memmap, os, pkgutil, py_
compile, sysconfig, tracemalloc, unittest, unittest.util
? pkg_resources imported from nose.plugins.manager
? posix imported from os
? pwd imported from distutils.archive_util, distutils.util, getpass, http.server
, netrc, pathlib, posixpath, shutil, tarfile, webbrowser
? scipy imported from numpy.testing.nosetester
? sets imported from nose.util, numpy.distutils.command.build_ext, numpy.distuti
ls.fcompiler, numpy.distutils.misc_util
? setuptools imported from numpy.distutils.core
? setuptools.command imported from numpy.distutils.core
? setuptools.command.bdist_rpm imported from numpy.distutils.command.bdist_rpm
? setuptools.command.develop imported from numpy.distutils.command.develop
? setuptools.command.egg_info imported from numpy.distutils.command.egg_info
? setuptools.command.install imported from numpy.distutils.command.install
? setuptools.command.sdist imported from numpy.distutils.command.sdist
? termios imported from getpass, tty
? unittest2.case imported from nose.plugins.skip
? urllib2 imported from numpy.lib._datasource
? urlparse imported from numpy.lib._datasource
? vms_lib imported from platform
This is not necessarily a problem - the modules may not be needed on this platfo
rm.
Copying data from package PyQt5...
copying C:\Users\aa82758\Anaconda3\lib\site-packages\PyQt5\QtCore.pyd -> build\e
xe.win-amd64-3.6\PyQt5\QtCore.pyd
copying C:\Users\aa82758\Anaconda3\Library\bin\Qt5Core.dll -> build\exe.win-amd6
4-3.6\Qt5Core.dll
copying C:\Users\aa82758\Anaconda3\Library\bin\zlib.dll -> build\exe.win-amd64-3
.6\zlib.dll
copying C:\Users\aa82758\Anaconda3\Library\bin\icuin57.dll -> build\exe.win-amd6
4-3.6\icuin57.dll
copying C:\Users\aa82758\Anaconda3\Library\bin\icuuc57.dll -> build\exe.win-amd6
4-3.6\icuuc57.dll
copying C:\Users\aa82758\Anaconda3\Library\bin\icudt57.dll -> build\exe.win-amd6
4-3.6\icudt57.dll
copying C:\Users\aa82758\Anaconda3\Library\bin\api-ms-win-crt-utility-l1-1-0.dll
-> build\exe.win-amd64-3.6\api-ms-win-crt-utility-l1-1-0.dll
copying C:\Users\aa82758\Anaconda3\Library\bin\MSVCP140.dll -> build\exe.win-amd
64-3.6\MSVCP140.dll
copying C:\Users\aa82758\Anaconda3\lib\site-packages\PyQt5\QtGui.pyd -> build\ex
e.win-amd64-3.6\PyQt5\QtGui.pyd
copying C:\Users\aa82758\Anaconda3\Library\bin\Qt5Gui.dll -> build\exe.win-amd64
-3.6\Qt5Gui.dll
copying C:\Users\aa82758\Anaconda3\Library\bin\libpng16.dll -> build\exe.win-amd
64-3.6\libpng16.dll
copying C:\Users\aa82758\Anaconda3\lib\site-packages\PyQt5\QtWidgets.pyd -> buil
d\exe.win-amd64-3.6\PyQt5\QtWidgets.pyd
copying C:\Users\aa82758\Anaconda3\Library\bin\Qt5Widgets.dll -> build\exe.win-a
md64-3.6\Qt5Widgets.dll
Copying data from package collections...
Copying data from package concurrent...
Copying data from package ctypes...
Copying data from package curses...
Copying data from package distutils...
Copying data from package email...
Copying data from package encodings...
Copying data from package html...
Copying data from package http...
Copying data from package importlib...
Copying data from package json...
Copying data from package lib2to3...
Copying data from package logging...
Copying data from package multiprocessing...
Copying data from package nose...
Copying data from package numpy...
copying C:\Users\aa82758\Anaconda3\lib\site-packages\numpy\core\multiarray.cp36-
win_amd64.pyd -> build\exe.win-amd64-3.6\numpy\core\multiarray.cp36-win_amd64.py
d
copying C:\Users\aa82758\Anaconda3\lib\site-packages\numpy\core\umath.cp36-win_a
md64.pyd -> build\exe.win-amd64-3.6\numpy\core\umath.cp36-win_amd64.pyd
copying C:\Users\aa82758\Anaconda3\lib\site-packages\numpy\fft\fftpack_lite.cp36
-win_amd64.pyd -> build\exe.win-amd64-3.6\numpy\fft\fftpack_lite.cp36-win_amd64.
pyd
copying C:\Users\aa82758\Anaconda3\lib\site-packages\numpy\linalg\lapack_lite.cp
36-win_amd64.pyd -> build\exe.win-amd64-3.6\numpy\linalg\lapack_lite.cp36-win_am
d64.pyd
copying C:\Users\aa82758\Anaconda3\lib\site-packages\numpy\random\mtrand.cp36-wi
n_amd64.pyd -> build\exe.win-amd64-3.6\numpy\random\mtrand.cp36-win_amd64.pyd
Copying data from package pydoc_data...
Copying data from package scipy...
Copying data from package unittest...
Copying data from package urllib...
Copying data from package xml...
Copying data from package xmlrpc...
copying C:\Users\aa82758\Anaconda3\DLLs\_bz2.pyd -> build\exe.win-amd64-3.6\_bz2
.pyd
copying C:\Users\aa82758\Anaconda3\DLLs\_ctypes.pyd -> build\exe.win-amd64-3.6\_
ctypes.pyd
copying C:\Users\aa82758\Anaconda3\DLLs\_decimal.pyd -> build\exe.win-amd64-3.6\
_decimal.pyd
copying C:\Users\aa82758\Anaconda3\DLLs\_hashlib.pyd -> build\exe.win-amd64-3.6\
_hashlib.pyd
copying C:\Users\aa82758\Anaconda3\DLLs\_lzma.pyd -> build\exe.win-amd64-3.6\_lz
ma.pyd
copying C:\Users\aa82758\Anaconda3\DLLs\_multiprocessing.pyd -> build\exe.win-am
d64-3.6\_multiprocessing.pyd
copying C:\Users\aa82758\Anaconda3\DLLs\_socket.pyd -> build\exe.win-amd64-3.6\_
socket.pyd
copying C:\Users\aa82758\Anaconda3\DLLs\_ssl.pyd -> build\exe.win-amd64-3.6\_ssl
.pyd
copying C:\Users\aa82758\Anaconda3\lib\site-packages\win32\_win32sysloader.pyd -
> build\exe.win-amd64-3.6\_win32sysloader.pyd
copying C:\Users\aa82758\Anaconda3\DLLs\pyexpat.pyd -> build\exe.win-amd64-3.6\p
yexpat.pyd
copying C:\Users\aa82758\Anaconda3\DLLs\select.pyd -> build\exe.win-amd64-3.6\se
lect.pyd
copying C:\Users\aa82758\Anaconda3\lib\site-packages\sip.pyd -> build\exe.win-am
d64-3.6\sip.pyd
copying C:\Users\aa82758\Anaconda3\DLLs\unicodedata.pyd -> build\exe.win-amd64-3
.6\unicodedata.pyd
copying C:\Users\aa82758\Anaconda3\lib\site-packages\win32\win32api.pyd -> build
\exe.win-amd64-3.6\win32api.pyd
copying C:\Users\aa82758\Anaconda3\lib\site-packages\win32\pywintypes36.dll -> b
uild\exe.win-amd64-3.6\pywintypes36.dll
copying C:\Users\aa82758\Anaconda3\lib\site-packages\win32\win32evtlog.pyd -> bu
ild\exe.win-amd64-3.6\win32evtlog.pyd
copying C:\Users\aa82758\Anaconda3\lib\site-packages\win32\win32pdh.pyd -> build
\exe.win-amd64-3.6\win32pdh.pyd
Questions : Did somebody had already this kind of problem? Do you know which of the missing modules are necessary for PyQt5 compilation? For instance IronPython is not available for python 3.6. Are there other methods for compiling except py2exe which is not working as well?
Thank you so much!
edit:
error message I get when I run the .exe file:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\aa82758>cd C:\Users\aa82758\Desktop\build\exe.win-amd64-3.6
C:\Users\aa82758\Desktop\build\exe.win-amd64-3.6>vsc.exe
Traceback (most recent call last):
File "C:\Users\aa82758\Anaconda3\lib\site-packages\cx_Freeze\initscripts\__sta
rtup__.py", line 14, in run
module.run()
File "C:\Users\aa82758\Anaconda3\lib\site-packages\cx_Freeze\initscripts\Conso
le.py", line 26, in run
exec(code, m.__dict__)
File "vsc.py", line 2, in <module>
File "C:\Users\aa82758\Anaconda3\lib\site-packages\numpy\__init__.py", line 14
2, in <module>
from . import add_newdocs
File "C:\Users\aa82758\Anaconda3\lib\site-packages\numpy\add_newdocs.py", line
13, in <module>
from numpy.lib import add_newdoc
File "C:\Users\aa82758\Anaconda3\lib\site-packages\numpy\lib\__init__.py", lin
e 8, in <module>
from .type_check import *
File "C:\Users\aa82758\Anaconda3\lib\site-packages\numpy\lib\type_check.py", l
ine 11, in <module>
import numpy.core.numeric as _nx
File "C:\Users\aa82758\Anaconda3\lib\site-packages\numpy\core\__init__.py", li
ne 36, in <module>
from . import numeric
File "C:\Users\aa82758\Anaconda3\lib\site-packages\numpy\core\numeric.py", lin
e 1842, in <module>
from .arrayprint import array2string, get_printoptions, set_printoptions
File "C:\Users\aa82758\Anaconda3\lib\site-packages\numpy\core\arrayprint.py",
line 24, in <module>
from .fromnumeric import ravel
File "C:\Users\aa82758\Anaconda3\lib\site-packages\numpy\core\fromnumeric.py",
line 15, in <module>
from . import _methods
ImportError: cannot import name '_methods'
C:\Users\aa82758\Desktop\build\exe.win-amd64-3.6>