Visual Studio Code, pylint complaining about “Unable to import XXX”

北城以北 提交于 2019-12-22 13:55:20

问题


I am using Visual Studio Code to work on a large python project with many modules.

My settings.json looks like this:

{
    "python.linting.pylintEnabled": true,
    "python.linting.enabled": true,
    "python.autoComplete.extraPaths": [
        "C:/Users/.../repos/platform",
    ],
    "python.linting.pylintPath": "pylint"
}

After that inside the code. I am getting a ton of error on all import modules which are inside the platform-folder. I have python3 installed with python extensions and pylint installed as well.

I have searched for over an another and tried many different suggestions but none has worked for me so far.


回答1:


The Current Problem you are facing is not regarding code formatting (by pylint). you would rather want to choose the interpreter you want to have Intellisense for. they are provided in docs as followed. link. Hope this helps. If it's TL;DR for you. just press F1 on vscode window and type Python:Select you will get right prompts.



来源:https://stackoverflow.com/questions/53007966/visual-studio-code-pylint-complaining-about-unable-to-import-xxx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!