成功解决ModuleNotFoundError: No module named codecs


鞋垫高挑
鞋垫高挑 2022-09-19 12:55:56 49904
分类专栏: 资讯

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

网站声明:如果转载,请联系本站管理员。否则一切后果自行承担。

本文链接:https://www.xckfsq.com/news/show.html?id=2503
赞同 0
评论 0 条
鞋垫高挑L1
粉丝 0 发表 9 + 关注 私信
上周热门
如何使用 StarRocks 管理和优化数据湖中的数据?  2956
【软件正版化】软件正版化工作要点  2875
统信UOS试玩黑神话:悟空  2839
信刻光盘安全隔离与信息交换系统  2733
镜舟科技与中启乘数科技达成战略合作,共筑数据服务新生态  1267
grub引导程序无法找到指定设备和分区  1231
华为全联接大会2024丨软通动力分论坛精彩议程抢先看!  165
2024海洋能源产业融合发展论坛暨博览会同期活动-海洋能源与数字化智能化论坛成功举办  163
点击报名 | 京东2025校招进校行程预告  163
华为纯血鸿蒙正式版9月底见!但Mate 70的内情还得接着挖...  159
本周热议
我的信创开放社区兼职赚钱历程 40
今天你签到了吗? 27
如何玩转信创开放社区—从小白进阶到专家 15
信创开放社区邀请他人注册的具体步骤如下 15
方德桌面操作系统 14
我有15积分有什么用? 13
用抖音玩法闯信创开放社区——用平台宣传企业产品服务 13
如何让你先人一步获得悬赏问题信息?(创作者必看) 12
2024中国信创产业发展大会暨中国信息科技创新与应用博览会 9
中央国家机关政府采购中心:应当将CPU、操作系统符合安全可靠测评要求纳入采购需求 8

加入交流群

请使用微信扫一扫!