Import error for rospy in Python3.6 script
I've tried import rospy into a python script that requires python3.6, but it gives me the error: ModuleNotFoundError: No module named 'rospy'
I'm able to successfully import the rospy into a python3.5 script.
So how can I install rospy package for python3.6 ?? When running in python 3.6 I first remove the path to the python2.7 link.
This works:
dev@dev:~/tool_system$ python3.5
Python 3.5.2 (default, Oct 8 2019, 13:06:37)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import rospy
>>>
This does not work:
dev@dev:~/tool_system$ python3.6
Python 3.6.10 (default, Dec 19 2019, 23:04:32)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path.remove('/opt/ros/kinetic/lib/python2.7/dist-packages')
>>> import rospy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'rospy'
>>>