pyinstaller執行出現:No module named 'Crypto.Math' 和 WARNING: lib not found: tbb.dll dependency


1. 在使用pyinstaller打包代碼成exe文件時,出現No module named 'Crypto.Math' 錯誤的原因應該是:現在名稱換了。

解決方法是:

pip uninstall crypto
pip uninstall pycryptodome
pip install pycryptodome

 

2.  lib not found的警告,沒找到很好的解決方法,就是默默地下載了幾個warning里面的dll文件放到對應路徑下,然后就沒該dll的warning了,下載不到的dll還是會出現warning。

注意的是:沒有下載這些dll時,我打包的exe文件也沒問題,可運行。

有warning的整個運行日志如下:

d16746 INFO: Loading module hook "hook-distutils.py"...
16747 INFO: Loading module hook "hook-encodings.py"...
16879 INFO: Loading module hook "hook-lib2to3.py"...
16882 INFO: Loading module hook "hook-numpy.core.py"...
16979 INFO: MKL libraries found when importing numpy. Adding MKL to binaries
16985 INFO: Loading module hook "hook-numpy.py"...
16987 INFO: Loading module hook "hook-pkg_resources.py"...
17753 INFO: Processing pre-safe import module hook   win32com
18151 INFO: Excluding import '__main__'
18153 INFO:   Removing import of __main__ from module pkg_resources
18154 INFO: Loading module hook "hook-pycparser.py"...
18330 INFO: Loading module hook "hook-pydoc.py"...
18331 INFO: Loading module hook "hook-pytest.py"...
19194 INFO: Loading module hook "hook-pythoncom.py"...
19915 INFO: Loading module hook "hook-pywintypes.py"...
20576 INFO: Loading module hook "hook-scipy.py"...
20579 INFO: Loading module hook "hook-setuptools.py"...
21490 INFO: Loading module hook "hook-sysconfig.py"...
21492 INFO: Loading module hook "hook-win32com.py"...
22177 INFO: Loading module hook "hook-xml.dom.domreg.py"...
22179 INFO: Loading module hook "hook-xml.etree.cElementTree.py"...
22179 INFO: Loading module hook "hook-xml.py"...
22209 INFO: Looking for ctypes DLLs
22260 INFO: Analyzing run-time hooks ...
22265 INFO: Including run-time hook 'pyi_rth_pkgres.py'
22267 INFO: Including run-time hook 'pyi_rth_win32comgenpy.py'
22269 INFO: Including run-time hook 'pyi_rth_multiprocessing.py'
22282 INFO: Looking for dynamic libraries
22348 WARNING: lib not found: tbb.dll dependency of d:\program_files\anaconda3\Library\bin\mkl_tbb_thread.dll
22497 WARNING: lib not found: impi.dll dependency of d:\program_files\anaconda3\Library\bin\mkl_blacs_intelmpi_ilp64.dll
22631 WARNING: lib not found: mpich2mpi.dll dependency of d:\program_files\anaconda3\Library\bin\mkl_blacs_mpich2_ilp64.dll
22637 WARNING: lib not found: msmpi.dll dependency of d:\program_files\anaconda3\Library\bin\mkl_blacs_msmpi_lp64.dll
22880 WARNING: lib not found: pgf90rtl.dll dependency of d:\program_files\anaconda3\Library\bin\mkl_pgi_thread.dll
22882 WARNING: lib not found: pgc14.dll dependency of d:\program_files\anaconda3\Library\bin\mkl_pgi_thread.dll
22886 WARNING: lib not found: pgf90.dll dependency of d:\program_files\anaconda3\Library\bin\mkl_pgi_thread.dll
22890 WARNING: lib not found: impi.dll dependency of d:\program_files\anaconda3\Library\bin\mkl_blacs_intelmpi_lp64.dll
22897 WARNING: lib not found: msmpi.dll dependency of d:\program_files\anaconda3\Library\bin\mkl_blacs_msmpi_ilp64.dll
23163 WARNING: lib not found: mpich2mpi.dll dependency of d:\program_files\anaconda3\Library\bin\mkl_blacs_mpich2_lp64.dll
23609 INFO: Looking for eggs
23610 INFO: Using Python library d:\program_files\anaconda3\python37.dll
23610 INFO: Found binding redirects:
[]
23619 INFO: Warnings written to D:\Python_workspace\spyder_space\test_exe\build\test_exe_1\warn-test_exe_1.txt
23715 INFO: Graph cross-reference written to D:\Python_workspace\spyder_space\test_exe\build\test_exe_1\xref-test_exe_1.html
23747 INFO: checking PYZ
23748 INFO: Building PYZ because PYZ-00.toc is non existent
23748 INFO: Building PYZ (ZlibArchive) D:\Python_workspace\spyder_space\test_exe\build\test_exe_1\PYZ-00.pyz
25063 INFO: Building PYZ (ZlibArchive) D:\Python_workspace\spyder_space\test_exe\build\test_exe_1\PYZ-00.pyz completed successfully.
25082 INFO: checking PKG
25082 INFO: Building PKG because PKG-00.toc is non existent
25083 INFO: Building PKG (CArchive) PKG-00.pkg
94937 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
94942 INFO: Bootloader d:\program_files\anaconda3\lib\site-packages\PyInstaller\bootloader\Windows-64bit\run.exe
94942 INFO: checking EXE
94943 INFO: Building EXE because EXE-00.toc is non existent
94943 INFO: Building EXE from EXE-00.toc
94944 INFO: Appending archive to EXE D:\Python_workspace\spyder_space\test_exe\dist\test_exe_1.exe
95118 INFO: Building EXE from EXE-00.toc completed successfully.

 

也有人說:從win10改到win7上打包,就沒這些警告:https://blog.csdn.net/dodwind/article/details/83107378

 

參考:

https://stackoverflow.com/questions/57713994/modulenotfounderror-no-module-named-crypto-math

https://blog.csdn.net/zoulonglong/article/details/79552813


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM