How to solve the “Unresolved Import Warning” when using Visual Studio Code for Python

How to solve the “Unresolved Import Warning” when using Visual Studio Code for Python
May 25, 2020 No Comments articles, How To's, Programming, Python siwelke

When using Visual Studio Code as a Python editor,you might encounter the “Unresolved import error” yet the code functions properly and the import is legit.

Here are some solutions that worked for me.

1.Set "python.jediEnabled` is `True` in the settings

  1. Go to command pallet by pressing CTRL+SHIFT+P
  2. Type: Configure Language Specific 
  3. Select Python and wait for the settings.json file to open
  4. Search for “python.jediEnabled
  5. Change its value from  False to True or comment it by adding a “#” at the start of that line
  6. Restart VS Code for the changes to take place.

 

NB:- Jedi is an awesome autocompletion, static analysis and refactoring library for python.Read more here: http://jedi.readthedocs.io

2.Set the Python environment or interpreter for your project

Always check the bottom left panel of VS Code to see what interpreter has been chosen for your project

About The Author

Leave a reply

Your email address will not be published.