成功解决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

 


相关文章
ModuleNotFoundError: No module named ‘mmdet.version‘
ModuleNotFoundError: No module named ‘mmdet.version‘
1533 0
|
5月前
|
Linux Shell iOS开发
ModuleNotFoundError: No module named 'readline' 是什么问题
【6月更文挑战第17天】ModuleNotFoundError: No module named 'readline' 是什么问题
501 1
Py3 ModuleNotFoundError: No module named ‘Crypto‘;ModuleNotFoundError: No module named Cryptodome‘
Py3 ModuleNotFoundError: No module named ‘Crypto‘;ModuleNotFoundError: No module named Cryptodome‘
99 0
|
6月前
|
Linux PyTorch 算法框架/工具
[已解决]ModuleNotFoundError: No module named ‘einops‘
[已解决]ModuleNotFoundError: No module named ‘einops‘
ModuleNotFoundError: No module named ‘exceptions‘
ModuleNotFoundError: No module named ‘exceptions‘
ModuleNotFoundError: No module named ‘sentencepiece‘
ModuleNotFoundError: No module named ‘sentencepiece‘
250 0
ModuleNotFoundError: No module named ‘pydensecrf‘解决办法
ModuleNotFoundError: No module named ‘pydensecrf‘解决办法
318 0
ModuleNotFoundError: No module named 'torchstat'
ModuleNotFoundError: No module named 'torchstat'
459 0
ModuleNotFoundError: No module named 'torchstat'
|
Python
ModuleNotFoundError: No module named ‘pyexpat‘
ModuleNotFoundError: No module named ‘pyexpat‘
222 0
|
机器学习/深度学习 数据可视化 TensorFlow
解决ModuleNotFoundError: No module named ‘tensorboardX‘问题
解决ModuleNotFoundError: No module named ‘tensorboardX‘问题
1390 0
解决ModuleNotFoundError: No module named ‘tensorboardX‘问题