pyinstaller - Executable file not working (Ubuntu-Python-PyQt-QGIS) -
for can help... issue this: have created python application wish turn cross platform executable 1 file. however, though pyinstaller executed without problem, executable not working. says "failed execute script". have tried both onefile , onedir options. python application's imports these (yes, lot necessary):
import os import sqlite3 import sys import easygui sys.path.append("/usr/bin/qgis") sys.path.append("~\.qgis2\python\plugins") pyqt4 import qtcore, qtgui pyqt4.qtcore import * pyqt4.qtgui import * geopy.exc import geocoderserviceerror geopy.geocoders import nominatim sklearn.decomposition import * sklearn.metrics import homogeneity_score, adjusted_rand_score #from pyqt4.qtcore import qt, qfileinfo, qsize pyqt4.qtnetwork import * pyqt4.qsci import * qgis.core import * qgis.gui import * qgis.utils import * pyqt4.qtxml import qdomdocument itertools import product # creating reports reportlab.lib import colors reportlab.lib.enums import ta_center reportlab.lib.pagesizes import portrait, a4 reportlab.lib.styles import getsamplestylesheet, paragraphstyle reportlab.lib.units import inch reportlab.pdfbase import pdfmetrics reportlab.pdfbase.ttfonts import ttfont reportlab.platypus import simpledoctemplate, paragraph, table, tablestyle, pagebreak, spacer, image # using separate python scripts cluster_gui import ui_cluster_analysis clustering_algorithms import * clustering_metrics import *
my application written in python 2.7 , pyinstaller version 3.2. browsing forums, read there known issue pyqt libraries , pyinstaller but, whatever suggestions are, haven't been able solve problem. suggestion write:
from pyqt4 import qtcore, qtgui
instead of
from pyqt4.qtcore import * pyqt4.qtgui import *
i don't know whether pyqt issue or else. please suggestion how solve or remark of libraries not compatible pyinstaller or guess how analyze issue.
thank in advance.
edit: result when execute pyinstaller
pyinstaller --onefile --path=/usr/bin/qgis:~\.qgis2\python\plugins:/usr/lib/x86_64-linux-gnu --noupx --icon=clusterpoints.svg mycluster.py 16 info: pyinstaller: 3.2 16 info: python: 2.7.12 16 info: platform: linux-4.4.0-38-generic-x86_64-with-ubuntu-16.04-xenial 16 info: wrote /home/*****/dropbox/mypythonfiles/mycluster.spec 23 info: upx not available. 26 info: extending pythonpath paths ['/home/*****/dropbox/mypythonfiles', '/usr/bin/qgis', '/home/*****/dropbox/mypythonfiles/~.qgis2pythonplugins', '/usr/lib/x86_64-linux-gnu', '/home/*****/dropbox/mypythonfiles'] 28 info: checking analysis 28 info: building analysis because out00-analysis.toc non existent 28 info: initializing module dependency graph... 30 info: initializing module graph hooks... 71 info: running analysis out00-analysis.toc 104 info: caching module hooks... 105 info: analyzing /home/*****/dropbox/mypythonfiles/mycluster.py 2066 info: processing pre-safe import module hook _xmlplus 2528 info: processing pre-find module path hook distutils 4022 info: processing pre-find module path hook site 4022 info: site: retargeting fake-dir '/usr/local/lib/python2.7/dist-packages/pyinstaller/fake-modules' 4040 info: processing pre-safe import module hook win32com traceback (most recent call last): file "<string>", line 2, in <module> importerror: no module named win32com 4057 info: processing pre-safe import module hook win32com traceback (most recent call last): file "<string>", line 2, in <module> importerror: no module named win32com 7136 info: processing pre-safe import module hook six.moves 17109 info: loading module hooks... 17109 info: loading module hook "hook-distutils.py"... 17110 info: loading module hook "hook-sysconfig.py"... 17110 info: loading module hook "hook-xml.py"... 17110 info: loading module hook "hook-pil.py"... 17114 info: excluding import 'fixtk' 17119 info: excluding import 'tkinter' 17123 info: excluding import 'pyqt5' 17127 warning: removing import pil.imageqt module pyqt5 17128 warning: removing import pil.imageqt module pyqt5.qrgba 17128 warning: removing import pil.imageqt module pyqt5.qpixmap 17128 warning: removing import pil.imageqt module pyqt5.qimage 17128 info: excluding import 'pyside' 17132 warning: removing import pil.imageqt module pyside.qpixmap 17132 warning: removing import pil.imageqt module pyside.qrgba 17132 warning: removing import pil.imageqt module pyside 17132 warning: removing import pil.imageqt module pyside.qimage 17132 info: excluding import 'pyqt4' 17138 warning: removing import pil.imageqt module pyqt4.qtgui.qimage 17138 warning: removing import pil.imageqt module pyqt4.qtcore 17138 warning: removing import pil.imageqt module pyqt4.qtgui.qpixmap 17138 warning: removing import pil.imageqt module pyqt4.qtcore.qiodevice 17138 warning: removing import pil.imageqt module pyqt4.qtcore.qbuffer 17138 warning: removing import pil.imageqt module pyqt4.qtgui.qrgba 17138 warning: removing import pil.imageqt module pyqt4.qtgui 17138 info: loading module hook "hook-gtk.py"... 17139 warning: hidden import "gtkglext" not found! 17139 warning: hidden import "gdkgl" not found! 17140 warning: hidden import "gdkglext" not found! 17140 warning: hidden import "gtk.gdk" not found! 17140 warning: hidden import "gtk.gtkgl" not found! 17140 warning: hidden import "gtk.gtkgl._gtkgl" not found! 17141 warning: hidden import "gtkgl" not found! 17203 info: loading module hook "hook-jinja2.py"... 17217 info: loading module hook "hook-httplib2.py"... 17218 info: loading module hook "hook-httplib.py"... 17218 info: loading module hook "hook-sklearn.metrics.cluster.py"... 17221 info: loading module hook "hook-pydoc.py"... 17225 info: excluding import 'tkinter' 17229 warning: removing import pydoc module tkinter 17229 info: loading module hook "hook-pyqt4.py"... 17230 info: loading module hook "hook-encodings.py"... 17467 info: loading module hook "hook-reportlab.pdfbase._fontdata.py"... 17471 info: loading module hook "hook-pyqt4.qtcore.py"... 17496 info: loading module hook "hook-_tkinter.py"... 17563 info: checking tree 17563 info: building tree because out00-tree.toc non existent 17563 info: building tree out00-tree.toc 17599 info: checking tree 17599 info: building tree because out01-tree.toc non existent 17599 info: building tree out01-tree.toc 17613 info: loading module hook "hook-matplotlib.backends.py"... 17999 info: matplotlib backend "gtk": added 18266 info: matplotlib backend "gtkagg": added 18529 info: matplotlib backend "gtkcairo": added 18748 info: matplotlib backend "macosx": ignored cannot import name _macosx 18994 info: matplotlib backend "qt4agg": added 19242 info: matplotlib backend "qt5agg": added 19484 info: matplotlib backend "tkagg": added 19697 info: matplotlib backend "wx": ignored matplotlib backend_wx , backend_wxagg require wxpython >=2.8.12 19909 info: matplotlib backend "wxagg": ignored matplotlib backend_wx , backend_wxagg require wxpython >=2.8.12 20022 info: matplotlib backend "gtk3cairo": ignored gtk3 backend requires pygobject installed. 20239 info: matplotlib backend "gtk3agg": ignored gtk3 backend requires pygobject installed. 20353 info: matplotlib backend "webagg": ignored traceback (most recent call last): file "<string>", line 12, in <module> file "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_webagg.py", line 30, in <module> raise runtimeerror("the webagg backend requires tornado.") runtimeerror: webagg backend requires tornado. 20473 info: matplotlib backend "nbagg": ignored no module named tornado.ioloop 20682 info: matplotlib backend "agg": added 20898 info: matplotlib backend "cairo": added 21015 info: matplotlib backend "emf": ignored no module named backend_emf 21273 info: matplotlib backend "gdk": added 21488 info: matplotlib backend "pdf": added 21717 info: matplotlib backend "pgf": added 21933 info: matplotlib backend "ps": added 22152 info: matplotlib backend "svg": added 22365 info: matplotlib backend "template": added 22670 info: loading module hook "hook-pil.image.py"... 22837 info: loading module hook "hook-matplotlib.py"... 22953 info: loading module hook "hook-pyqt4.qtgui.py"... 23084 info: loading module hook "hook-pyqt4.qtnetwork.py"... 23109 info: loading module hook "hook-pkg_resources.py"... 23360 info: processing pre-safe import module hook win32com traceback (most recent call last): file "<string>", line 2, in <module> importerror: no module named win32com 23375 info: processing pre-safe import module hook win32com traceback (most recent call last): file "<string>", line 2, in <module> importerror: no module named win32com 23391 info: processing pre-safe import module hook win32com traceback (most recent call last): file "<string>", line 2, in <module> importerror: no module named win32com 23409 info: processing pre-safe import module hook win32com traceback (most recent call last): file "<string>", line 2, in <module> importerror: no module named win32com 23428 info: loading module hook "hook-scipy.linalg.py"... 23428 info: loading module hook "hook-scipy.sparse.csgraph.py"... 23431 info: loading module hook "hook-pytz.py"... 23432 info: loading module hook "hook-setuptools.py"... 23432 info: loading module hook "hook-scipy.special._ellip_harm_2.py"... 23432 info: loading module hook "hook-pil.spiderimageplugin.py"... 23439 info: excluding import 'fixtk' 23443 info: excluding import 'tkinter' 23447 info: loading module hook "hook-sqlalchemy.py"... 23573 info: found 4 sqlalchemy hidden imports 23574 warning: hidden import "pysqlite2" not found! 23574 warning: hidden import "mysqldb" not found! 24221 warning: hidden import "sqlalchemy.sql.functions.func" not found! 24226 info: import excluded not found: 'sqlalchemy.testing' 24226 info: loading module hook "hook-sqlite3.py"... 24227 info: loading module hook "hook-scipy.special._ufuncs.py"... 24228 info: loading module hook "hook-pyqt4.qtxml.py"... 24228 info: loading module hook "hook-reportlab.lib.utils.py"... 24231 info: loading module hook "hook-psycopg2.py"... 24364 info: looking ctypes dlls 24481 info: analyzing run-time hooks ... 24502 info: including run-time hook 'pyi_rth_mplconfig.py' 24503 info: including run-time hook 'pyi_rth_mpldata.py' 24504 info: including run-time hook 'pyi_rth_pkgres.py' 24505 info: including run-time hook 'pyi_rth_qt4plugins.py' 24506 info: including run-time hook 'pyi_rth__tkinter.py' 24545 info: looking dynamic libraries 27855 info: looking eggs 27855 info: python library not in binary depedencies. doing additional searching... 27885 info: using python library /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0 27938 info: warnings written /home/*****/dropbox/mypythonfiles/build/mycluster/warnmycluster.txt 28268 info: checking pyz 28268 info: building pyz because out00-pyz.toc non existent 28268 info: building pyz (zlibarchive) /home/*****/dropbox/mypythonfiles/build/mycluster/out00-pyz.pyz 30348 info: checking pkg 30348 info: building pkg because out00-pkg.toc non existent 30348 info: building pkg (carchive) out00-pkg.pkg 102269 info: bootloader /usr/local/lib/python2.7/dist-packages/pyinstaller/bootloader/linux-64bit/run 102269 info: checking exe 102269 info: building exe because out00-exe.toc non existent 102269 info: building exe out00-exe.toc 102269 info: appending archive elf section in exe /home/*****/dropbox/mypythonfiles/dist/mycluster *****@*****:~/dropbox/mypythonfiles$ cd dist*****@*****:~/dropbox/mypythonfiles/dist$ ./myclustertraceback (most recent call last): file "mycluster.py", line 39, in <module> file "/usr/local/lib/python2.7/dist-packages/pyinstaller/loader/pyimod03_importers.py", line 389, in load_module exec(bytecode, module.__dict__) file "clustering_algorithms.py", line 9, in <module> file "/usr/local/lib/python2.7/dist-packages/pyinstaller/loader/pyimod03_importers.py", line 389, in load_module exec(bytecode, module.__dict__) file "sklearn/cluster/__init__.py", line 6, in <module> file "/usr/local/lib/python2.7/dist-packages/pyinstaller/loader/pyimod03_importers.py", line 389, in load_module exec(bytecode, module.__dict__) file "sklearn/cluster/spectral.py", line 17, in <module> file "/usr/local/lib/python2.7/dist-packages/pyinstaller/loader/pyimod03_importers.py", line 389, in load_module exec(bytecode, module.__dict__) file "sklearn/neighbors/__init__.py", line 6, in <module> file "/usr/local/lib/python2.7/dist-packages/pyinstaller/loader/pyimod03_importers.py", line 546, in load_module module = imp.load_module(fullname, fp, filename, ext_tuple) file "sklearn/neighbors/dist_metrics.pxd", line 48, in init sklearn.neighbors.ball_tree (sklearn/neighbors/ball_tree.c:36366) file "/usr/local/lib/python2.7/dist-packages/pyinstaller/loader/pyimod03_importers.py", line 546, in load_module module = imp.load_module(fullname, fp, filename, ext_tuple) file "sklearn/neighbors/dist_metrics.pyx", line 52, in init sklearn.neighbors.dist_metrics (sklearn/neighbors/dist_metrics.c:27473) importerror: no module named typedefs failed execute script mycluster
Comments
Post a Comment