当前位置:   article > 正文

解决打包过程中出现 ModuleNotFoundError: No module named ‘pydicom.encoders.gdcm‘ 报错的方法_modulenotfounderror: no module named 'pydicom

modulenotfounderror: no module named 'pydicom

问题描述

在pycharm中可以正常运行,但是打包完成后再次运行时提示丢包

Microsoft Windows [版本 10.0.19044.2251]
(c) Microsoft Corporation。保留所有权利。

C:\Users\yb.chen>C:\Users\yb.chen\PycharmProjects\pythonProject\dist\MainWindow.exe
Traceback (most recent call last):
  File "MainWindow.py", line 4, in <module>
  File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
  File "disposed_main.py", line 2, in <module>
  File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
  File "pydicom\__init__.py", line 32, in <module>
  File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
  File "pydicom\dataelem.py", line 18, in <module>
  File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
  File "pydicom\config.py", line 365, in <module>
  File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
  File "pydicom\pixel_data_handlers\rle_handler.py", line 51, in <module>
  File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
  File "pydicom\encoders\__init__.py", line 1, in <module>
  File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
  File "pydicom\encoders\base.py", line 864, in <module>
  File "pydicom\encoders\base.py", line 84, in add_plugin
  File "importlib\__init__.py", line 126, in import_module
ModuleNotFoundError: No module named 'pydicom.encoders.pylibjpeg'
[53576] Failed to execute script 'MainWindow' due to unhandled exception!
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24

解决方法

重新以下面的方式进行打包

 pyinstaller -F --collect-submodules=pydicom MainWindow.py
  • 1
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/78973
推荐阅读
相关标签
  

闽ICP备14008679号