[英]Python path in VS Code on Linux
So, this has been covered a number of times already, and there's some good documentation on how things are supposed to work here .所以,这已经被讨论过很多次了,并且有一些很好的文档说明这里应该如何工作。 Except: nothing seems to work for me, How do I debug this?
除了:似乎没有什么对我有用,我该如何调试? what am I missing: I've tried the following things:
我错过了什么:我尝试了以下事情:
PYTHONPATH
in .env
in the root of my workspace.env
中设置PYTHONPATH
"python.envFile": ".env"
to .vscode/settings.json
"python.envFile": ".env"
到.vscode/settings.json
.env
to .vscode/env
, update python.envFile
to reflect.env
移动到.vscode/env
,更新python.envFile
以反映python.autoComplete.extraPaths
to .vscode/settings.json
python.autoComplete.extraPaths
添加到.vscode/settings.json
settings
key, repeat the steps abovesettings
键的工作区配置,重复上述步骤PYTHONPATH=directory code.
PYTHONPATH=directory code.
All of the above is completely ignored, pylint keeps on complaining.以上所有内容都被完全忽略了,pylint 一直在抱怨。 I am getting a bit frustrated.
我有点沮丧。 What am I missing here!
我在这里错过了什么!
Right, cause found.对了,找到原因了。 Even outside of VS Code
pylint
was acting up.甚至在 VS Code
pylint
之外都在发挥作用。 Source of the problem: the top-level dir also contained an __init__.py
file, messing up all sorts of things.问题的根源:顶级目录还包含一个
__init__.py
文件,搞砸了各种事情。 Remove that file and it starts working...删除该文件,它开始工作......
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.