成功解决ModuleNotFoundError: No module named 'codecs'

简介: 成功解决ModuleNotFoundError: No module named 'codecs'

解决问题


Fatal Python error: Py_Initialize: unable to load the file system codec

Traceback (most recent call last):

 File "f:\program files\python\python36\lib\encodings\__init__.py", line 31, in

ModuleNotFoundError: No module named 'codecs'


ModuleNotFoundError: No module named 'codecs'




解决思路


找不到模块错误:没有名为“codecs”的模块




解决方法


T1、


(1)、先在主代码中尝试下边的代码


if not True:

   import codecs


(2)、更新一下编译库即可!或者codecs!


T2、也可以在打包使用的时候,将该模块隐藏即可!


--hidden-import= module

T3、或者直接在主函数文件内,添加下边代码即可!


import codecs

 


相关文章
|
7月前
|
Linux iOS开发 索引
【已解决】ModuleNotFoundError: No module named ‘matplotlib‘
【已解决】ModuleNotFoundError: No module named ‘matplotlib‘
ModuleNotFoundError: No module named ‘mmdet.version‘
ModuleNotFoundError: No module named ‘mmdet.version‘
1544 0
|
6月前
|
Linux Shell iOS开发
ModuleNotFoundError: No module named 'readline' 是什么问题
【6月更文挑战第17天】ModuleNotFoundError: No module named 'readline' 是什么问题
605 1
Py3 ModuleNotFoundError: No module named ‘Crypto‘;ModuleNotFoundError: No module named Cryptodome‘
Py3 ModuleNotFoundError: No module named ‘Crypto‘;ModuleNotFoundError: No module named Cryptodome‘
105 0
|
7月前
|
Linux PyTorch 算法框架/工具
[已解决]ModuleNotFoundError: No module named ‘einops‘
[已解决]ModuleNotFoundError: No module named ‘einops‘
ModuleNotFoundError: No module named ‘exceptions‘
ModuleNotFoundError: No module named ‘exceptions‘
109 0
ModuleNotFoundError: No module named ‘sentencepiece‘
ModuleNotFoundError: No module named ‘sentencepiece‘
269 0
ModuleNotFoundError: No module named ‘pydensecrf‘解决办法
ModuleNotFoundError: No module named ‘pydensecrf‘解决办法
344 0
ModuleNotFoundError: No module named 'torchstat'
ModuleNotFoundError: No module named 'torchstat'
498 0
ModuleNotFoundError: No module named 'torchstat'
|
Python
ModuleNotFoundError: No module named ‘pyexpat‘
ModuleNotFoundError: No module named ‘pyexpat‘
234 0