Search code examples
pythonros

Problem with importing rospy and roslib libraries


I am new to ROS and python. This question could be silly but spent almost 5 hours on this. I am using PyCharm (Latest version) with Python 2.7.15 64 bit (Also tried with 3.x). I need to import a few libraries as below:

import roslib;
roslib.load_manifest('smach_tutorials')
import rospy
import smach
import smach_ros

However, PyCharm fails to identify roslib, rospy, smach and smach_ros (could not find in the interpreter also to import). The above libraries are example given in the official site:

http://wiki.ros.org/smach/Tutorials/Simple%20State%20Machine

OS: Windows 7 (64 bit)

ROS not installed: ("SMACH is a ROS-independent Python library to build hierarchical state machines" - from the official site)

Error Traceback:

Traceback (most recent call last):
File "C:/Users/****/Desktop/Python/TestCharm.py", line 3, in <module>
import roslib;
ModuleNotFoundError: No module named 'roslib'

Solution

  • Thanks for all the support. I found out it is not possible for my perticular case to use SMACH because it has dependency on catkin. I am using Windows 7 and should be upgraded to windows 10 or use Ununtu Linux.