【发布时间】:2018-07-14 12:21:45
【问题描述】:
我正在为我的博士论文编写一个 Python 数据评估工具,并希望在我们的工作组中分发它。出于这个原因,我试图用 pyinstaller 编译它,但到目前为止失败了:
PyInstaller 的日志是: (我不小心命名了构建“uild”的目录,这并不重要)
[florians@flos-linux ~]$ sh ./Sciebo/Python/NMR\ Projects/installGUI
245 INFO: PyInstaller: 3.3.1
245 INFO: Python: 3.6.3
246 INFO: Platform: Linux-4.15.0-1-MANJARO-x86_64-with-arch-Manjaro-Linux
246 INFO: wrote /home/florians/eNMRsuite.spec
249 INFO: UPX is available.
249 INFO: Removing temporary files and cleaning cache in /home/florians/.cache/pyinstaller
258 INFO: Extending PYTHONPATH with paths
['/home/florians/Sciebo/Python/NMR Projects', '/home/florians']
258 INFO: checking Analysis
258 INFO: Building Analysis because out00-Analysis.toc is non existent
258 INFO: Initializing module dependency graph...
260 INFO: Initializing module graph hooks...
261 INFO: Analyzing base_library.zip ...
3878 INFO: Analyzing hidden import 'sklearn.neighbors.typedefs'
5184 INFO: Processing pre-find module path hook distutils
7708 INFO: Processing pre-find module path hook site
7708 INFO: site: retargeting to fake-dir '/opt/anaconda/lib/python3.6/site-packages/PyInstaller/fake-modules'
12752 INFO: Processing pre-safe import module hook six.moves
17830 INFO: Processing pre-safe import module hook urllib3.packages.six.moves
41759 INFO: running Analysis out00-Analysis.toc
41782 INFO: Caching module hooks...
41786 INFO: Analyzing /home/florians/Sciebo/Python/NMR Projects/GUI_alpha_0.0.0.py
57841 INFO: Loading module hooks...
57841 INFO: Loading module hook "hook-PyQt5.QtWidgets.py"...
57842 INFO: Loading module hook "hook-PIL.py"...
57846 INFO: Import to be excluded not found: 'FixTk'
57846 INFO: Excluding import 'PySide'
57851 INFO: Removing import of PySide from module PIL.ImageQt
57851 INFO: Excluding import 'PyQt4'
57855 INFO: Removing import of PyQt4 from module PIL.ImageQt
57855 INFO: Excluding import 'PyQt5'
57860 INFO: Removing import of PyQt5.QtGui from module PIL.ImageQt
57860 INFO: Removing import of PyQt5.QtCore from module PIL.ImageQt
57860 INFO: Excluding import 'tkinter'
57865 INFO: Loading module hook "hook-lib2to3.py"...
57867 INFO: Loading module hook "hook-zmq.py"...
58843 INFO: Excluding import 'zmq.libzmq'
58848 INFO: Removing import of zmq.libzmq from module zmq
58849 INFO: Loading module hook "hook-numpy.core.py"...
58963 INFO: MKL libraries found when importing numpy. Adding MKL to binaries
58965 INFO: Loading module hook "hook-pytest.py"...
59605 INFO: Loading module hook "hook-scipy.special._ellip_harm_2.py"...
59606 INFO: Loading module hook "hook-openpyxl.py"...
59608 INFO: Loading module hook "hook-xml.etree.cElementTree.py"...
59608 INFO: Loading module hook "hook-IPython.py"...
59615 INFO: Excluding import 'matplotlib'
59623 INFO: Removing import of matplotlib._pylab_helpers from module IPython.core.pylabtools
59623 INFO: Removing import of matplotlib.figure from module IPython.core.pylabtools
59623 INFO: Removing import of matplotlib from module IPython.core.pylabtools
59623 INFO: Removing import of matplotlib.pyplot from module IPython.core.pylabtools
59624 INFO: Excluding import 'gtk'
59633 INFO: Excluding import 'PySide'
59641 INFO: Removing import of PySide from module IPython.external.qt_loaders
59642 INFO: Excluding import 'PyQt4'
59650 INFO: Removing import of PyQt4 from module IPython.external.qt_loaders
59651 INFO: Excluding import 'PyQt5'
59659 INFO: Removing import of PyQt5.QtGui from module IPython.external.qt_loaders
59659 INFO: Removing import of PyQt5.QtCore from module IPython.external.qt_loaders
59659 INFO: Removing import of PyQt5.QtSvg from module IPython.external.qt_loaders
59659 INFO: Removing import of PyQt5 from module IPython.external.qt_loaders
59659 INFO: Removing import of PyQt5.QtWidgets from module IPython.external.qt_loaders
59660 INFO: Loading module hook "hook-scipy.special._ufuncs.py"...
59660 INFO: Loading module hook "hook-pycparser.py"...
59906 INFO: Loading module hook "hook-pytz.py"...
59923 INFO: Loading module hook "hook-PyQt5.py"...
59924 INFO: Loading module hook "hook-PyQt5.Qt.py"...
59925 INFO: Loading module hook "hook-xml.dom.domreg.py"...
59925 INFO: Loading module hook "hook-sqlalchemy.py"...
60095 INFO: Found 3 sqlalchemy hidden imports
60095 WARNING: Hidden import "MySQLdb" not found!
60107 WARNING: Hidden import "sqlalchemy.sql.functions.func" not found!
60116 INFO: Excluding import 'sqlalchemy.testing'
60122 INFO: Removing import of sqlalchemy.testing.util from module sqlalchemy.orm.util
60123 INFO: Removing import of sqlalchemy.testing.engines from module sqlalchemy.testing
60123 INFO: Removing import of sqlalchemy.testing.config from module sqlalchemy.testing
60123 INFO: Removing import of sqlalchemy.testing.exclusions from module sqlalchemy.testing
60123 INFO: Removing import of sqlalchemy.testing.mock from module sqlalchemy.testing
60123 INFO: Removing import of sqlalchemy.testing from module sqlalchemy.testing
60123 INFO: Removing import of sqlalchemy.testing.assertions from module sqlalchemy.testing
60123 INFO: Removing import of sqlalchemy.testing.util from module sqlalchemy.testing
60123 INFO: Removing import of sqlalchemy.testing.warnings from module sqlalchemy.testing
60123 INFO: Removing import of sqlalchemy.testing.assertsql from module sqlalchemy.testing
60124 INFO: Removing import of sqlalchemy.testing from module sqlalchemy.testing.warnings
60124 INFO: Removing import of sqlalchemy.testing.assertions from module sqlalchemy.testing.warnings
60124 INFO: Removing import of sqlalchemy.testing.config from module sqlalchemy.testing.assertions
60124 INFO: Removing import of sqlalchemy.testing.mock from module sqlalchemy.testing.assertions
60124 INFO: Removing import of sqlalchemy.testing.exclusions from module sqlalchemy.testing.assertions
60124 INFO: Removing import of sqlalchemy.testing from module sqlalchemy.testing.assertions
60124 INFO: Removing import of sqlalchemy.testing.util from module sqlalchemy.testing.assertions
60124 INFO: Removing import of sqlalchemy.testing.assertsql from module sqlalchemy.testing.assertions
60124 INFO: Removing import of sqlalchemy.testing.engines from module sqlalchemy.testing.util
60124 INFO: Removing import of sqlalchemy.testing from module sqlalchemy.testing.util
60124 INFO: Removing import of sqlalchemy.testing.config from module sqlalchemy.testing.util
60124 INFO: Removing import of sqlalchemy.testing from module sqlalchemy.testing.config
60125 INFO: Removing import of sqlalchemy.testing.util from module sqlalchemy.testing.engines
60125 INFO: Removing import of sqlalchemy.testing from module sqlalchemy.testing.engines
60125 INFO: Removing import of sqlalchemy.testing.config from module sqlalchemy.testing.engines
60125 INFO: Removing import of sqlalchemy.testing.assertions from module sqlalchemy.testing.engines
60127 INFO: Removing import of sqlalchemy.testing from module sqlalchemy.testing.exclusions
60127 INFO: Removing import of sqlalchemy.testing.config from module sqlalchemy.testing.exclusions
60127 INFO: Removing import of sqlalchemy.testing from module sqlalchemy.testing.assertsql
60128 INFO: Removing import of sqlalchemy.testing from module sqlalchemy.testing.mock
60128 INFO: Loading module hook "hook-PIL.Image.py"...
60676 INFO: Loading module hook "hook-setuptools.py"...
60717 INFO: Loading module hook "hook-pygments.py"...
63334 INFO: Loading module hook "hook-sklearn.metrics.cluster.py"...
63404 WARNING: Hidden import "sklearn.utils.sparsetools._graph_validation" not found!
63404 WARNING: Hidden import "sklearn.utils.sparsetools._graph_tools" not found!
63404 INFO: Loading module hook "hook-lxml.etree.py"...
63405 INFO: Loading module hook "hook-PyQt5.QtSvg.py"...
63405 INFO: Loading module hook "hook-gevent.monkey.py"...
63411 INFO: Loading module hook "hook-docutils.py"...
64350 INFO: Loading module hook "hook-PyQt5.QtPrintSupport.py"...
64409 INFO: Loading module hook "hook-sqlite3.py"...
64471 INFO: Loading module hook "hook-requests.py"...
64472 INFO: Loading module hook "hook-scipy.sparse.csgraph.py"...
64475 INFO: Loading module hook "hook-certifi.py"...
64475 INFO: Loading module hook "hook-sysconfig.py"...
64484 INFO: Loading module hook "hook-matplotlib.backends.py"...
64942 INFO: Matplotlib backend "GTK": ignored
Gtk* backend requires pygtk to be installed.
65305 INFO: Matplotlib backend "GTKAgg": ignored
Gtk* backend requires pygtk to be installed.
65553 INFO: Matplotlib backend "GTKCairo": ignored
No module named 'gtk'
65954 INFO: Matplotlib backend "MacOSX": ignored
cannot import name '_macosx'
66418 INFO: Matplotlib backend "Qt4Agg": added
66857 INFO: Matplotlib backend "Qt5Agg": added
67274 INFO: Matplotlib backend "TkAgg": added
67663 INFO: Matplotlib backend "WX": ignored
Matplotlib backend_wx and backend_wxagg require wxPython >=2.8.12
68031 INFO: Matplotlib backend "WXAgg": ignored
Matplotlib backend_wx and backend_wxagg require wxPython >=2.8.12
68274 INFO: Matplotlib backend "GTK3Cairo": ignored
Cairo backend requires that cairocffi or pycairo is installed.
68656 INFO: Matplotlib backend "GTK3Agg": ignored
Gtk3 backend requires pygobject to be installed.
69111 INFO: Matplotlib backend "WebAgg": ignored
Traceback (most recent call last):
File "<string>", line 12, in <module>
File "/opt/anaconda/lib/python3.6/site-packages/matplotlib/backends/backend_webagg.py", line 327, in <module>
class _BackendWebAgg(_Backend):
File "/opt/anaconda/lib/python3.6/site-packages/matplotlib/backends/backend_webagg.py", line 329, in _BackendWebAgg
FigureManager = FigureManagerWebAgg
NameError: name 'FigureManagerWebAgg' is not defined
70349 INFO: Matplotlib backend "nbAgg": added
70724 INFO: Matplotlib backend "agg": added
70962 INFO: Matplotlib backend "cairo": ignored
Cairo backend requires that cairocffi or pycairo is installed.
71196 INFO: Matplotlib backend "gdk": ignored
No module named 'gobject'
71574 INFO: Matplotlib backend "pdf": added
71993 INFO: Matplotlib backend "pgf": added
72385 INFO: Matplotlib backend "ps": added
72759 INFO: Matplotlib backend "svg": added
73150 INFO: Matplotlib backend "template": added
73463 INFO: Loading module hook "hook-PyQt5.QtGui.py"...
73870 INFO: Loading module hook "hook-encodings.py"...
73941 INFO: Loading module hook "hook-babel.py"...
73961 INFO: Loading module hook "hook-distutils.py"...
73962 INFO: Loading module hook "hook-matplotlib.py"...
74199 INFO: Loading module hook "hook-jinja2.py"...
74220 INFO: Loading module hook "hook-scipy.linalg.py"...
74221 INFO: Loading module hook "hook-PyQt5.QtCore.py"...
74282 INFO: Loading module hook "hook-tables.py"...
74283 INFO: Loading module hook "hook-pkg_resources.py"...
74611 INFO: Processing pre-safe import module hook win32com
74970 INFO: Loading module hook "hook-_tkinter.py"...
75088 INFO: checking Tree
75088 INFO: Building Tree because out00-Tree.toc is non existent
75088 INFO: Building Tree out00-Tree.toc
75095 INFO: checking Tree
75095 INFO: Building Tree because out01-Tree.toc is non existent
75095 INFO: Building Tree out01-Tree.toc
75099 INFO: Loading module hook "hook-sphinx.py"...
78111 INFO: Loading module hook "hook-pydoc.py"...
78112 INFO: Loading module hook "hook-jsonschema.py"...
78112 INFO: Loading module hook "hook-cryptography.py"...
78410 INFO: Loading module hook "hook-xml.py"...
78413 INFO: Loading module hook "hook-PIL.SpiderImagePlugin.py"...
78422 INFO: Import to be excluded not found: 'FixTk'
78423 INFO: Excluding import 'tkinter'
78560 INFO: Looking for ctypes DLLs
79235 WARNING: library user32 required via ctypes not found
80115 INFO: Analyzing run-time hooks ...
80193 INFO: Including run-time hook 'pyi_rth__tkinter.py'
80196 INFO: Including run-time hook 'pyi_rth_traitlets.py'
80198 INFO: Including run-time hook 'pyi_rth_mplconfig.py'
80200 INFO: Including run-time hook 'pyi_rth_mpldata.py'
80202 INFO: Including run-time hook 'pyi_rth_qt5.py'
80205 INFO: Including run-time hook 'pyi_rth_pkgres.py'
80206 INFO: Including run-time hook 'pyi_rth_multiprocessing.py'
80282 INFO: Looking for dynamic libraries
ldd: Warnung: Sie haben kein Ausführungsrecht für `/opt/anaconda/lib/python3.6/site-packages/PyQt5/QtWidgets.so'
ldd: Warnung: Sie haben kein Ausführungsrecht für `/opt/anaconda/lib/python3.6/site-packages/PyQt5/QtX11Extras.so'
ldd: Warnung: Sie haben kein Ausführungsrecht für `/opt/anaconda/lib/python3.6/site-packages/PyQt5/QtGui.so'
ldd: Warnung: Sie haben kein Ausführungsrecht für `/opt/anaconda/lib/python3.6/site-packages/PyQt5/QtSvg.so'
ldd: Warnung: Sie haben kein Ausführungsrecht für `/opt/anaconda/lib/python3.6/site-packages/PyQt5/Qt.so'
ldd: Warnung: Sie haben kein Ausführungsrecht für `/opt/anaconda/lib/python3.6/site-packages/PyQt5/QtPrintSupport.so'
ldd: Warnung: Sie haben kein Ausführungsrecht für `/opt/anaconda/lib/python3.6/site-packages/PyQt5/QtCore.so'
ldd: Warnung: Sie haben kein Ausführungsrecht für `/opt/anaconda/plugins/platforms/../../lib/libgcc_s.so.1'
84911 INFO: Looking for eggs
84911 INFO: Using Python library /opt/anaconda/lib/python3.6/site-packages/sklearn/neighbors/../../../../libpython3.6m.so.1.0
84954 INFO: Warnings written to /home/florians/Sciebo/Python/NMR Projects/GUIapp/uild/eNMRsuite/warneNMRsuite.txt
85351 INFO: Graph cross-reference written to /home/florians/Sciebo/Python/NMR Projects/GUIapp/uild/eNMRsuite/xref-eNMRsuite.html
85511 INFO: checking PYZ
85512 INFO: Building PYZ because out00-PYZ.toc is non existent
85512 INFO: Building PYZ (ZlibArchive) /home/florians/Sciebo/Python/NMR Projects/GUIapp/uild/eNMRsuite/out00-PYZ.pyz
90244 INFO: Building PYZ (ZlibArchive) /home/florians/Sciebo/Python/NMR Projects/GUIapp/uild/eNMRsuite/out00-PYZ.pyz completed successfully.
90333 INFO: checking PKG
90333 INFO: Building PKG because out00-PKG.toc is non existent
90333 INFO: Building PKG (CArchive) out00-PKG.pkg
90488 INFO: Building PKG (CArchive) out00-PKG.pkg completed successfully.
90489 INFO: Bootloader /opt/anaconda/lib/python3.6/site-packages/PyInstaller/bootloader/Linux-64bit/run_d
90489 INFO: checking EXE
90489 INFO: Building EXE because out00-EXE.toc is non existent
90490 INFO: Building EXE from out00-EXE.toc
90490 INFO: Appending archive to ELF section in EXE /home/florians/Sciebo/Python/NMR Projects/GUIapp/uild/eNMRsuite/eNMRsuite
90565 INFO: Building EXE from out00-EXE.toc completed successfully.
90590 INFO: checking COLLECT
90590 INFO: Building COLLECT because out00-COLLECT.toc is non existent
90590 INFO: Removing dir /home/florians/Sciebo/Python/NMR Projects/GUIapp/dist/eNMRsuite
90939 INFO: Building COLLECT out00-COLLECT.toc
92416 INFO: Building COLLECT out00-COLLECT.toc completed successfully.
[florians@flos-linux ~]$
我在 Lenovo T470 上运行带有最新内核的 Manjaro-Linux
所以我收到了一些我不明白的警告。结果是,当我尝试运行程序时,会发生这种情况:
[15105] PyInstaller Bootloader 3.x
[15105] LOADER: executable is /home/florians/Sciebo/Python/NMR Projects/GUIapp/dist/eNMRsuite/eNMRsuite
[15105] LOADER: homepath is /home/florians/Sciebo/Python/NMR Projects/GUIapp/dist/eNMRsuite
[15105] LOADER: _MEIPASS2 is NULL
[15105] LOADER: archivename is /home/florians/Sciebo/Python/NMR Projects/GUIapp/dist/eNMRsuite/eNMRsuite
[15105] LOADER: Extracting binaries
[15105] LOADER: Executing self as child
[15105] LOADER: set _MEIPASS2 to /home/florians/Sciebo/Python/NMR Projects/GUIapp/dist/eNMRsuite
[15105] LOADER: LD_LIBRARY_PATH=/home/florians/Sciebo/Python/NMR Projects/GUIapp/dist/eNMRsuite
[15106] PyInstaller Bootloader 3.x
[15106] LOADER: executable is /home/florians/Sciebo/Python/NMR Projects/GUIapp/dist/eNMRsuite/eNMRsuite
[15106] LOADER: homepath is /home/florians/Sciebo/Python/NMR Projects/GUIapp/dist/eNMRsuite
[15106] LOADER: _MEIPASS2 is /home/florians/Sciebo/Python/NMR Projects/GUIapp/dist/eNMRsuite
[15106] LOADER: archivename is /home/florians/Sciebo/Python/NMR Projects/GUIapp/dist/eNMRsuite/eNMRsuite
[15106] LOADER: Already in the child - running user's code.
[15106] LOADER: Python library: /home/florians/Sciebo/Python/NMR Projects/GUIapp/dist/eNMRsuite/libpython3.6m.so.1.0
[15106] LOADER: Loaded functions from Python library.
[15106] LOADER: Manipulating environment (sys.path, sys.prefix)
[15106] LOADER: Pre-init sys.path is /home/florians/Sciebo/Python/NMR Projects/GUIapp/dist/eNMRsuite/base_library.zip:/home/florians/Sciebo/Python/NMR Projects/GUIapp/dist/eNMRsuite
[15106] LOADER: sys.prefix is /home/florians/Sciebo/Python/NMR Projects/GUIapp/dist/eNMRsuite
[15106] LOADER: Setting runtime options
[15106] LOADER: Initializing python
[15106] LOADER: Overriding Python's sys.path
[15106] LOADER: Post-init sys.path is /home/florians/Sciebo/Python/NMR Projects/GUIapp/dist/eNMRsuite/base_library.zip:/home/florians/Sciebo/Python/NMR Projects/GUIapp/dist/eNMRsuite
[15106] LOADER: Setting sys.argv
[15106] LOADER: setting sys._MEIPASS
[15106] LOADER: importing modules from CArchive
[15106] LOADER: extracted struct
[15106] LOADER: callfunction returned...
[15106] LOADER: extracted pyimod01_os_path
[15106] LOADER: callfunction returned...
[15106] LOADER: extracted pyimod02_archive
[15106] LOADER: callfunction returned...
[15106] LOADER: extracted pyimod03_importers
[15106] LOADER: callfunction returned...
[15106] LOADER: Installing PYZ archive with Python modules.
[15106] LOADER: PYZ archive: out00-PYZ.pyz
[15106] LOADER: Running pyiboot01_bootstrap.py
[15106] LOADER: Running pyi_rth__tkinter.py
[15106] LOADER: Running pyi_rth_traitlets.py
[15106] LOADER: Running pyi_rth_mplconfig.py
[15106] LOADER: Running pyi_rth_mpldata.py
[15106] LOADER: Running pyi_rth_qt5.py
[15106] LOADER: Running pyi_rth_pkgres.py
[15106] LOADER: Running pyi_rth_multiprocessing.py
[15106] LOADER: Running GUI_alpha_0.0.0.py
/home/florians/Sciebo/Python/NMR Projects/GUIapp/dist/eNMRsuite/eNMRsuite: symbol lookup error: /home/florians/Sciebo/Python/NMR Projects/GUIapp/dist/eNMRsuite/libmkl_intel_thread.so: undefined symbol: omp_get_num_procs
[15105] LOADER: Back to parent (RC: 127)
[15105] LOADER: Doing cleanup
[15105] LOADER: Freeing archive status for /home/florians/Sciebo/Python/NMR Projects/GUIapp/dist/eNMRsuite/eNMRsuite
我还没有尝试在 Windows 下编译它,但在 Linux 上编译它对于让程序在我们的实验室计算机上运行非常重要
感谢您提供任何提示/提示或任何建议
【问题讨论】:
标签: linux python-3.x pyinstaller