no module named rospkg

The reason this error occurs is because Python packages in /opt are added to PYTHONPATH environment variable BUT for ones in /usr, path does not exist in PYTHONPATH variable. The python-rospkg gets installed in /usr by default. So you just need following line in .bashrc to fix this:

export PYTHONPATH=$PYTHONPATH:/usr/lib/python2.7/dist-packages
ok,it can work for me

猜你喜欢

转载自blog.csdn.net/jianghao_ava/article/details/81025849