首页 > 解决方案 > Pylint:'无法导入'pathlib'(导入错误)'

问题描述

为什么 pylint 说它可以导入内置模块?我的代码执行没有错误,在 python.exe 中我可以加载任何内置或 pip 安装的模块。

PS F:\z0py> python.exe -m pylint .\jake9wi_file_hashing\
************* Module jake9wi_file_hashing.funcs
jake9wi_file_hashing\funcs.py:3:0: E0401: Unable to import 'pathlib' (import-error)
jake9wi_file_hashing\funcs.py:4:0: E0401: Unable to import 'hashlib' (import-error)
jake9wi_file_hashing\funcs.py:5:0: E0401: Unable to import 'json' (import-error)
************* Module jake9wi_file_hashing.__main__
jake9wi_file_hashing\__main__.py:2:0: E0401: Unable to import 'os' (import-error)
jake9wi_file_hashing\__main__.py:4:0: E0401: Unable to import 'pathlib' (import-error)

------------------------------------------------------------------
Your code has been rated at 7.13/10 (previous run: 7.05/10, +0.08)

标签: pythonpylint

解决方案


推荐阅读