成功解決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 <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'. * getregentry() -> codecs.CodecInfo object 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對象 此外,模塊還可以選擇定義以下api,然後由包的編解碼器搜索功能使用: * getaliases() -編碼名稱字符串作爲別名的>序列 getaliases()返回的別名必須是normalize_encoding()定義的規範化編碼名。 作者Marc-Andre Lemburg ([email protected])。 (c) CNRI版權所有不保修的。 |
解決方法
1、第一次嘗試—在系統環境變量內添加路徑
PYTHONPATH
F:/Program Files/Python/Python36/Lib