Configure VS code to understand ros package imports

asked 2023-07-21 08:27:53 -0500

infraviored gravatar image

I am importing lots of packages into other packages. I can execute the imported packages without any problems. But the linking in VS code is not working, Pylance is giving me import errors.

I have a workspace called happyspace. The path to the dist-packages is


so I added this to my workspace config:

    "folders": [
            "path": "."
    "settings": {
        "editor.fontSize": 15,
        "[python]": {
            "editor.defaultFormatter": "ms-python.autopep8"
        "python.formatting.provider": "none",
        "editor.defaultFormatter": null,
        "python.autoComplete.extraPaths": [
        "python.analysis.extraPaths": [

however, upon imports of one package into another, like for example in my in located in


the line

from fmp_tracepen_node.tracepen_node import TracepenNode

gets the error

Import "fmp_tracepen_node.tracepen_node" could not be resolvedPylancereportMissingImports (module) fmp_tracepen_node

while the file to be imported sits in


What am I doing wrong?

help is greatly appreciated.

edit retag flag offensive close merge delete


Related, but not problem-solving for me.

infraviored gravatar image infraviored  ( 2023-07-24 10:24:40 -0500 )edit

I need help. No advice?

infraviored gravatar image infraviored  ( 2023-07-27 13:45:42 -0500 )edit