‘Import “Path.to.own.script” could not be resolved Pylance (reportMissingImports)’ in VS Code using Python 3.x on Ubuntu 20.04 LTS

Pylance, by default, includes the root path of your workspace. If you want to include other subdirectories as import resolution paths, you can add them using the python.analysis.extraPaths setting for the workspace.

  • In VS Code press <ctrl> + <,> to open Settings.
  • Type in python.analysis.extraPaths
  • Select “Add Item”
  • Type in the path to your library /home/andylu/Dokumente/Allgemeines_material/Sonstiges/Programming/Python/Scripts/

Leave a Comment