ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

成功解决ModuleNotFoundError: No module named codecs

2020-05-20 12:37:51  阅读:4888  来源: 互联网

标签:named encoding Python No module 模块 codecs must


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

 

 

 

目录

解决问题

解决思路

解决方法

1、第一次尝试—在系统环境变量内添加路径


 

 

解决问题

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 <module>
ModuleNotFoundError: No module named 'codecs'

 

 

 

解决思路

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

""" Standard "encodings" Package

    Standard Python encoding modules are stored in this package directory.

    Codec modules must have names corresponding to normalized encoding names as defined in the normalize_encoding() function below, e.g. 'utf-8' must be implemented by the module 'utf_8.py'.
    Each codec module must export the following interface:

    * getregentry() -> codecs.CodecInfo object
    The getregentry() API must return a CodecInfo object with encoder, decoder,  incrementalencoder, incrementaldecoder, streamwriter and streamreader   atttributes which adhere to the Python Codec Interface Standard.

    In addition, a module may optionally also define the following APIs which are then used by the package's codec search function:

    * getaliases() -> sequence of encoding name strings to use as aliases

    Alias names returned by getaliases() must be normalized encoding names as defined by normalize_encoding().

Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

"""标准""编码"包

标准Python编码模块存储在这个包目录中。

编解码器模块必须具有与下面normalize_encoding()函数中定义的规范化编码名称相对应的名称,例如。“utf-8”必须由模块“utf_8.py”实现。
每个编解码器模块必须导出以下接口:

* getregentry() ->编解码器。CodecInfo对象
getregentry() API必须返回一个CodecInfo对象,该对象具有符合Python编解码接口标准的编码器、解码器、增量编码器、增量解码器、streamwriter和streamreader atttributes。

此外,模块还可以选择定义以下api,然后由包的编解码器搜索功能使用:

* getaliases() -编码名称字符串作为别名的>序列

getaliases()返回的别名必须是normalize_encoding()定义的规范化编码名。

作者Marc-Andre Lemburg (mal@lemburg.com)。

(c) CNRI版权所有不保修的。

 

 

解决方法

1、第一次尝试—在系统环境变量内添加路径

PYTHONPATH
F:/Program Files/Python/Python36/Lib

 

 

 

标签:named,encoding,Python,No,module,模块,codecs,must
来源: https://blog.csdn.net/qq_41185868/article/details/106212766

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有