成功解决ModuleNotFoundError: No module named codecs

成功解决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 ([email protected]).

(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 ([email protected])。

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

 

 

解决方法

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

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

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章