ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Import "xxx.msg" could not be resolved

asked 2022-03-29 03:50:34 -0500

emrebaba54 gravatar image

updated 2022-03-29 08:22:09 -0500

Mike Scheutzow gravatar image

I am facing this error constantly when i ran vscode. Sometimes, it is happening however such as there is no problem running clearly. I looked for but I haven't found any answer yet. As far as i see, this problem can be caused 2 way. Firstly, Interpreter selection, secondly and in my opinion ROS extencion doesn't work clearly. Because sometimes i am closing the vscode and i am running again like this problem is solving such as temporarly. Please Help Me !

For instance:

import rospy, cv2, cv_bridge, numpy        # (cv_bridge and the file that msgs couldn't be resolved)
from sensor_msgs.msg import Image
from geometry_msgs.msg import Twist

The output of the program is as follows:

Import "sensor_msgs.msg" could not be resolvedPylancereportMissingImports

edit retag flag offensive close merge delete


I guess i invent new thing. If i include the my workspace folder again, ros extension can define the .msg's but if i continue from where we left off, for the folder has been opened before, ros extension can't define the files. The problem has been solved as temporarly not real solve.

emrebaba54 gravatar image emrebaba54  ( 2022-03-29 05:34:44 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2022-03-29 08:24:24 -0500

Mike Scheutzow gravatar image

How to configure vscode has been discussed many times on this site. Try typing the term vscode into the search box at the top of this page.

edit flag offensive delete link more


Thanks for your advice sir. Even though i looking for vscode topics on this site, i couldn't find exactly what i was looking for. Can you help me if there is any topic about this problem?

emrebaba54 gravatar image emrebaba54  ( 2022-04-01 00:24:59 -0500 )edit

Question Tools

1 follower


Asked: 2022-03-29 03:50:34 -0500

Seen: 850 times

Last updated: Mar 29 '22