Pyinstaller libmkl_intel_thread.so:未定义符号:omp_get_num_procs

问题描述 投票:0回答:4

我正在为我的博士论文编写一个数据评估工具,并希望将其分发到我们的工作组中。由于这个原因,我尝试用 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
4个回答
2
投票
  • 原因: 正如@iain所说,这是因为你的

    libiomp5.so
    目录中不存在
    $CONDA_PREFIX/lib/

  • 解决方案:运行

    conda install llvm-openmp -c conda-forge


参考:ContinuumIO/anaconda-issues #10195

我从 conda-forge 切换回默认值后遇到了这个问题,因为我想将 Spyder 更新到 4.1.4。

在我的安装中,库

libiomp5.so
存在于几个不同的
anaconda3/pks/
子文件夹中,但不在
anaconda3/lib/
中,即使在执行
conda update intel-openmp
之后也是如此。

我注意到该库也是

llvm-openmp
的一部分,并且也安装了该库,从而修复了它!

也许强制重新安装

intel-openmp
也会有效。


1
投票

我在 Manjaro 上冻结 GUI 应用程序时遇到了同样的问题。

我解决了在 conda-enviroment 上安装 numpy+openBlas 包而不是 Numpy+MKL 的问题。

使用 -c conda-forge 通道很容易安装它。

在这里你可以看到我的环境。

[victor@victor-manjaro ~]$ conda list -n pyside
packages in environment at /home/victor/miniconda3/envs/pyside:
Name                    Version                   Build  Channel
alabaster                 0.7.10           py36h306e16b_0  
altgraph                  0.15                      <pip>
apipkg                    1.4                       <pip>
asn1crypto                0.24.0                   py36_0  
astroid                   1.6.1                    py36_0  
attrs                     17.4.0                    <pip>
babel                     2.5.3                    py36_0  
blas                      1.1                    openblas    conda-forge
bleach                    2.1.2                    py36_0  
ca-certificates           2018.1.18                     0    conda-forge
cairo                     1.14.6                        4    conda-forge
certifi                   2018.1.18                py36_0    conda-forge
cffi                      1.11.4           py36h9745a5d_0  
chardet                   3.0.4            py36h0f667ec_1  
cloudpickle               0.5.2                    py36_1  
cryptography              2.1.4            py36hd09be54_0  
cudatoolkit               8.0                           3  
cycler                    0.10.0                   py36_0    conda-forge
decorator                 4.1.2                    py36_0    conda-forge
dicompyler-core           0.5.3                     <pip>
docutils                  0.14             py36hb0f60f5_0                                                                                                                                                                                    
entrypoints               0.2.3            py36h1aec115_2                                                                                                                                                                                    
execnet                   1.5.0                     <pip>                                                                                                                                                                                    
fontconfig                2.12.1                        4    conda-forge                                                                                                                                                                     
freetype                  2.7                           1    conda-forge                                                                                                                                                                     
future                    0.16.0                    <pip>                                                                                                                                                                                    
geos                      3.6.2                heeff764_2                                                                                                                                                                                    
gettext                   0.19.8.1                      0    conda-forge                                                                                                                                                                     
giflib                    5.1.4                         0    conda-forge                                                                                                                                                                     
glib                      2.51.4                        0    conda-forge                                                                                                                                                                     
gmp                       6.1.2                h6c8ec71_1                                                                                                                                                                                    
graphite2                 1.3.10                        0    conda-forge                                                                                                                                                                     
harfbuzz                  1.3.4                         2    conda-forge                                                                                                                                                                     
hdf5                      1.8.17                       11    conda-forge                                                                                                                                                                     
html5lib                  1.0.1            py36h2f9c1c0_0                                                                                                                                                                                    
icu                       58.2                          0    conda-forge                                                                                                                                                                     
idna                      2.6              py36h82fb2a8_1                                                                                                                                                                                    
imagesize                 1.0.0                    py36_0                                                                                                                                                                                    
inspyred                  1.0.1                     <pip>                                                                                                                                                                                    
intel-openmp              2018.0.0             hc7b2577_8                                                                                                                                                                                    
ipykernel                 4.8.2                    py36_0                                                                                                                                                                                    
ipython                   6.2.1                    py36_1    conda-forge                                                                                                                                                                     
ipython_genutils          0.2.0                    py36_0    conda-forge                                                                                                                                                                     
isort                     4.3.4                    py36_0                                                                                                                                                                                    
jasper                    1.900.1                       4    conda-forge                                                                                                                                                                     
jedi                      0.11.1                   py36_0    conda-forge                                                                                                                                                                     
jinja2                    2.10             py36ha16c418_0                                                                                                                                                                                    
joblib                    0.11                     py36_0    conda-forge                                                                                                                                                                     
jpeg                      9b                            2    conda-forge                                                                                                                                                                     
jsonschema                2.6.0            py36h006f8b5_0                                                                                                                                                                                    
jupyter_client            5.2.2                    py36_0                                                                                                                                                                                    
jupyter_core              4.4.0            py36h7c827e3_0  
lazy-object-proxy         1.3.1            py36h10fcdad_0  
libedit                   3.1                  heed3624_0  
libffi                    3.2.1                hd88cf55_4  
libgcc-ng                 7.2.0                h7cc24e2_2  
libgfortran               3.0.0                         1  
libgfortran-ng            7.2.0                h9f7466a_2  
libiconv                  1.15                          0    conda-forge
libpng                    1.6.34                        0    conda-forge
libsodium                 1.0.15               hf101ebd_0  
libstdcxx-ng              7.2.0                h7a57d05_2  
libtiff                   4.0.7                         1    conda-forge
libwebp                   0.5.2                         7    conda-forge
libxml2                   2.9.7                         0    conda-forge
libxslt                   1.1.32                        0    conda-forge
llvmlite                  0.22.0           py36ha27ea49_0  
macholib                  1.9                       <pip>
markupsafe                1.0              py36hd9260cd_1  
matplotlib                2.0.0               np112py36_2    conda-forge
mccabe                    0.6.1            py36h5ad9710_1  
mistune                   0.8.3                    py36_0  
mkl                       2018.0.1             h19d6760_4  
nbconvert                 5.3.1            py36hb41ffb7_0  
nbformat                  4.4.0            py36h31c9010_0  
ncurses                   6.0                  h9df7e31_2  
numba                     0.37.0          np112py36ha11926f_0  
numpy                     1.12.1          py36_blas_openblas_201  [blas_openblas]  conda-forge
numpydoc                  0.7.0            py36h18f165f_0  
olefile                   0.45.1                   py36_0    conda-forge
openblas                  0.2.20                        7    conda-forge
opencv3                   3.1.0                    py36_0    menpo
openssl                   1.0.2n                        0    conda-forge
packaging                 16.8             py36ha668100_1  
pandas                    0.22.0           py36hf484d3e_0  
pandoc                    1.19.2.1             hea2e7c5_1  
pandocfilters             1.4.2            py36ha6701b7_1  
pango                     1.40.3                        3    conda-forge
parso                     0.1.1                      py_0    conda-forge
pcre                      8.39                          0    conda-forge
pefile                    2017.11.5                 <pip>
pexpect                   4.4.0                    py36_0    conda-forge
pickleshare               0.7.4                    py36_0    conda-forge
pillow                    4.3.0                    py36_1    conda-forge
pip                       9.0.1            py36h6c6f9ce_4  
pixman                    0.34.0                        1    conda-forge
pluggy                    0.6.0                     <pip>
prompt_toolkit            1.0.15                   py36_0    conda-forge
psutil                    5.4.3            py36h14c3975_0  
ptyprocess                0.5.2                    py36_0    conda-forge
py                        1.5.2                     <pip>
pycodestyle               2.3.1            py36hf609f19_0  
pycparser                 2.18             py36hf9f622e_1  
pydicom                   1.0.0a1                   <pip>
pyflakes                  1.6.0            py36h7bd6a15_0  
pygments                  2.2.0                    py36_0    conda-forge
PyInstaller               3.3.1                     <pip>
pylint                    1.8.2                    py36_0  
pyopenssl                 17.5.0           py36h20ba746_0  
pyparsing                 2.2.0                    py36_0    conda-forge
pyqt                      4.11.4                   py36_2    conda-forge
pyqtgraph                 0.10.0                    <pip>
pyside                    1.2.4                    py36_8    conda-forge
pysocks                   1.6.7            py36hd97a5b1_1  
pytest                    3.4.1                     <pip>
pytest-forked             0.2                       <pip>
pytest-pycharm            0.5.0                     <pip>
pytest-qt                 2.3.1                     <pip>
pytest-xdist              1.22.1                    <pip>
python                    3.6.2                         0  
python-dateutil           2.6.1                    py36_0    conda-forge
pytz                      2018.3                     py_0    conda-forge
pyzmq                     16.0.3           py36he2533c7_0  
qt                        4.8.7                         7    conda-forge
qtawesome                 0.4.4            py36h609ed8c_0  
qtconsole                 4.3.1            py36h8f73b5b_0  
qtpy                      1.3.1            py36h3691cc8_0  
quantities                0.12.1                    <pip>
readline                  6.2                           2  
reportlab                 3.4.0                    py36_0    conda-forge
requests                  2.18.4           py36he2e5f8d_1  
rope                      0.10.7           py36h147e2ec_0  
scipy                     1.0.0           py36_blas_openblas_201  [blas_openblas]  conda-forge
setuptools                38.5.1                   py36_0  
shapely                   1.6.4            py36h0c48222_0  
simplegeneric             0.8.1                    py36_0    conda-forge
sip                       4.18                     py36_1    conda-forge
six                       1.11.0                   py36_1    conda-forge
snowballstemmer           1.2.1            py36h6febd40_0  
sphinx                    1.7.0                    py36_0  
sphinxcontrib             1.0              py36h6d0f590_1  
sphinxcontrib-websupport  1.0.1            py36hb5cb234_1  
spyder                    3.2.7                    py36_0  
sqlite                    3.13.0                        1    conda-forge
tabulate                  0.8.2                    py36_0  
testpath                  0.3.1            py36h8cadb63_0  
tifffile                  0.10.0              np112py36_0    conda-forge
tk                        8.5.18                        0  
tornado                   4.5.3                    py36_0    conda-forge
traitlets                 4.3.2                    py36_0    conda-forge
typing                    3.6.4                    py36_0  
urllib3                   1.22             py36hbe7ace6_0  
wcwidth                   0.1.7                    py36_0    conda-forge
webencodings              0.5.1            py36h800622e_1  
wheel                     0.30.0           py36hfd4bba0_1  
wrapt                     1.10.11          py36h28b7045_0  
xlrd                      1.1.0            py36h1db9f0c_1  
xlsxwriter                1.0.2            py36h3de1aca_0  
xlwt                      1.3.0            py36h7b00a1f_0  
xz                        5.2.3                h55aa19d_2  
zeromq                    4.2.2                hbedb6e5_2  
zlib                      1.2.11               ha838bed_2  

您还可以使用 nomkl numpy 环境进行测试:

conda create -n new_env nomkl numpy scipy

希望对你有帮助!

维克多


1
投票

发生此错误是因为 pyinstaller 在构建包时缺少

libiomp5.so
库。
libiomp5.so
是定义函数
omp_get_num_procs
的位置,因此您需要包含它。

我使用 conda 安装了 MKL,因此该库位于

/opt/conda/lib/libiomp5.so
。您可以使用
sudo find / -name libiomp5.so
按照 this SO 答案 搜索文件。

一旦获得库的位置,您需要将其作为二进制文件添加到 pyinstaller 设置中。我把它作为标志传递了:

pyinstaller --add-binary "/opt/conda/lib/libiomp5.so:." src/my_program.py

如果您愿意,也可以将其添加到规范文件中。 这是 pyinstaller 文档


0
投票

将 conda-forge 与默认包管理器混合后遇到了同样的问题。 就我而言,这个命令有效:

conda install intel-openmp --update-deps --force-reinstall

希望它对未来的任何人有帮助!

© www.soinside.com 2019 - 2024. All rights reserved.