Importing a module that uses rospy from a module in Python3
Hi. I have a library that is fully written in Python3.5 and I want to interface it with a module that I wrote. The module that I wrote imports rospy, so it depends on Python2.7. When I try to do this I get the following error:
python3 script_running_library_in_python3.py
Traceback (most recent call last):
File "script_running_library_in_python3.py", line 11, in <module>
from module_using_rospy.core import SomeClass
File "/home/hamza/catkin_ws/src/module_using_rospy/module_using_rospy/core.py", line 9, in <module>
import rospy
File "/opt/ros/indigo/lib/python2.7/dist-packages/rospy/__init__.py", line 49, in <module>
from .client import spin, myargv, init_node, \
File "/opt/ros/indigo/lib/python2.7/dist-packages/rospy/client.py", line 47, in <module>
import yaml
File "/usr/local/lib/python2.7/dist-packages/yaml/__init__.py", line 2, in <module>
from error import *
ImportError: No module named 'error'
Any idea how I could make this work? Thank you!