pylint无法导入本地模块
我的项目具有以下结构:
some_dir/
__init__.py
main_prog.py
support
__init__.py
some_file.py
main_prog.py.py
中的代码具有以下操作:
from support.some_file import SomeClass
所有功能正常,但Pylint
未能导入someClass
。
需要做什么?我正在终端运行(不使用VSCODE),并且期望“ Pylint”的工作方式与Python 3.8.10相同的工作方式,
请注意,我使用的是 venv ,它具有以下包装:
astroid==2.11.6
dill==0.3.5.1
HiYaPyCo==0.5.0
isort==5.10.1
Jinja2==3.1.2
lazy-object-proxy==1.7.1
MarkupSafe==2.1.1
mccabe==0.7.0
platformdirs==2.5.2
pylint==2.14.3
PyYAML==5.4.1
tomli==2.0.1
tomlkit==0.11.0
typing_extensions==4.2.0
wrapt==1.14.1
其他答案:其他答案Stackoverflow似乎没有涵盖此简单的情况。
My project has the following structure:
some_dir/
__init__.py
main_prog.py
support
__init__.py
some_file.py
The code in main_prog.py
has the following:
from support.some_file import SomeClass
All works correctly but pylint
fails to import SomeClass
.
What needs to be done? I am running in a terminal (not using VSCode) and would expect `pylint' to simply work the same way as Python 3.8.10
Note I am using a venv which has the following packages:
astroid==2.11.6
dill==0.3.5.1
HiYaPyCo==0.5.0
isort==5.10.1
Jinja2==3.1.2
lazy-object-proxy==1.7.1
MarkupSafe==2.1.1
mccabe==0.7.0
platformdirs==2.5.2
pylint==2.14.3
PyYAML==5.4.1
tomli==2.0.1
tomlkit==0.11.0
typing_extensions==4.2.0
wrapt==1.14.1
Other answers on StackOverflow do not appear to cover this simple scenario.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论