catkin_make error: ImportError: No module named 'error'
So, i am a beginner in ROS i have this error every time i do a catkin_make
Traceback (most recent call last):
File "/opt/ros/kinetic/share/genpy/cmake/../../../lib/genpy/genmsg_py.py", line 44, in <module>
import genpy.generator
File "/opt/ros/kinetic/lib/python2.7/dist-packages/genpy/__init__.py", line 34, in <module>
from . message import Message, SerializationError, DeserializationError, MessageException, struct_I
File "/opt/ros/kinetic/lib/python2.7/dist-packages/genpy/message.py", line 44, in <module>
import yaml
File "/usr/lib/python2.7/dist-packages/yaml/__init__.py", line 2, in <module>
from error import *
ImportError: No module named 'error'
and after a lot of googling i figured that the problem is because of the PYTHONPATH.
so to check my PYTHONPATH is did
echo $PYTHONPATH
and i got
/home/username/catkin_ws/devel/lib/python3/dist-packages:/opt/ros/kinetic/lib/python2.7/dist-packages
i think the reason behind the problem is the "/python3/dist-package" how do i change it ? i tried adding the path manually in ~/.bashrc
export PYTHONPATH=$PYTHONPATH:/usr/lib/python2.7/dist-packages
but still every time i doecho $PYTHONPATH
i get
/opt/ros/kinetic/lib/python2.7/dist-packages:/home/username/catkin_ws/devel/lib/python3/dist-packages:/usr/lib/python2.7/dist-packages:/usr/lib/python2.7/dist-packages:/usr/lib/python2.7/dist-packages
how do i solve this ? Please HELP !