When I import rospy in Pycharm, rospy is marked with a red underline, i.e.,
However, this does not affect the running of the program, i.e., I can still communicate with the ROS nodes.
It does not seem to be a serious problem, but it bothers me a lot.
I have checked the Python interpreter in Settings and the related packages have been installed.
Besides, I have finished the ROS environment setup in zshrc and started Pycharm in the terminal with the sh command.
Has anyone else met the same issue? Thanks in advance!
Ros version: Noetic
Python version: py3.8 in /usr/bin
For the convenience of those who are experiencing the same problem, I'll give my solution here.
I have
toucha.pthfile in/usr/local/lib/python3.8/dist-packages, where/opt/ros/noetic/lib/python3/dist-packageswas added.