Visual Studio Code, Pylint Complaining About "unable To Import Xxx"
Solution 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.
Solution 2:
The answer above helped me out, thanks @srinath samala! Sharing why this worked for me in case it helps someone else.
I've been running Python on Windows 10 for a while, and months later installed Anaconda, which I don't think I did quite according to best practices. Windows machines can be annoying about proper PATH config etc...I probably need to uninstall and reinstall anaconda?
In any case, using the F1 key and Python:Select to point VS code toward which Python.exe file was being used made the difference here. Apparently using pip install in a windows bash session might make those packages available for one environment v the other? I'm sure this has something to do with my own (currently janky) directory structure, but VS code defaulted to Python's original home, and I got the import error. By selecting anaconda's version it found the package. Hope this helps someone else!
Post a Comment for "Visual Studio Code, Pylint Complaining About "unable To Import Xxx""