在用pyinstaller打包python程序
pyinstaller版本为:3.3.1
python 版本:3.6.1
系统版本:Windows-10-10.0.16299-SP0
我的python程序名为:data_processing_gui.py
程序在python环境下正常运行。
打包使用的格式为:pyinstaller -F -p <导入的包路径> myprogram.py
完整打包命令为:
pyinstaller -F -p C:\Users\fanyu\Anaconda3\Lib;C:\Users\fanyu\Anaconda3\Lib\site-packages;C:\Users\fanyu\Anaconda3\Lib\site-packages\PyQt5\Qt\bin;C:\Users\fanyu\Anaconda3\Lib\site-packages\pydicom;C:\Users\fanyu\Anaconda3\Lib\site-packages\radiomics;C:\Users\fanyu\Anaconda3\Lib\site-packages\pywt;C:\Users\fanyu\Anaconda3\Lib\site-packages\pywt\_extensions;C:\Users\fanyu\Anaconda3\Lib\site-packages\tensorflow;C:\Users\fanyu\Anaconda3\Lib\site-packages\SimpleITK;C:\Users\fanyu\Anaconda3\Lib\site-packages\PIL;C:\Users\fanyu\Anaconda3\Lib\site-packages\pandas;C:\Users\fanyu\Anaconda3\Lib\site-packages\nrrd;C:\Users\fanyu\Anaconda3\Lib\site-packages\numpy -i C:\Users\fanyu\Desktop\work\package\image\doctor.ico data_processing_gui.py
pause
打包过程无报错,打包完成后运行程序提示出错信息:
Traceback (most recent call last):
File "data_processing_gui.py", line 12, in <module>
File "c:\users\fanyu\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\radiomics\__init__.py", line 15, in <module>
File "c:\users\fanyu\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\radiomics\imageoperations.py", line 6, in <module>
File "c:\users\fanyu\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\pywt\__init__.py", line 17, in <module>
File "c:\users\fanyu\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\pywt\_functions.py", line 17, in <module>
File "c:\users\fanyu\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 714, in load_module
module = loader.load_module(fullname)
File "pywt/_extensions/_pywt.pyx", line 1, in init pywt._extensions._pywt (pywt\_extensions\_pywt.c:31281)
ModuleNotFoundError: No module named 'pywt._extensions._cwt'
[7564] Failed to execute script data_processing_gui
这里给出的错误是找不到包,但是打包时已包含了pywt._extensions的路径,不知什么地方有错误,求大神支招~