No module named 'rospy' in pycharm, i have ros melodic and python 2.7. in my code it is showing rospy module not found. and when i was installing rospy module with the command : sudo apt -y install python-rospy then it is showing :
The following packages have unmet dependencies: python-rospy : Depends: python-roslib but it is not going to be installed E: Unable to correct problems, you have held broken packages.
i want to fix the rospy module issue in my code.
Two potential issues can cause this. The first, and most unlikely is that you have installed ROS incorrectly. You need to make sure you're installing the full version of ROS via
sudo apt-get install ros-melodic-desktop-full. You may also need to try and fix the broken packages viasudo apt-get install -f. Followed by a clean and upgrade:sudo apt-get clean && sudo apt-get update; then you can try to reinstall.If it's installed correctly you should make sure you've included it in Pycharm. You should go to
Project > Project Interpreterand make surerospkgis added.