Install imutils within ROS

痞子三分冷 提交于 2019-12-08 09:39:35

问题


I have an Ubuntu 16.04 OS with ROS kinetic.

When I open a terminal and type python it loads python 2.7, and as I try to import imutils it says it's not there.

Then, I tried to install it with pip install imutils, but it says: requirment already satisfied in bla/bla/python3.5/bla.

If I open the terminal and type python3, it loads Python 3.5, and when I try to import that lib, it complaints that it can't find cv2, and gives an address pointing to where the Python ROS package is located (Python 2.7).

Up to this point, it makes sense to me (I am aware of the .bashrc loading the ROS packages), but then, how can I install imutils in the Python version of ROS? I want to use the compatible imutils with my ROS Kinetic.


回答1:


Your problem is that your pip is set to Python 3.5.

So, you can bypass it using pip2 instead:

pip2 install imutils

or

sudo pip2 install imutils

[NOTE]:

Check your pip s link to Python versions assignment:

pip --version
pip2 --version
pip3 --version
sudo pip --version
sudo pip2 --version
sudo pip3 --version

Then choose the desired Python version which assigned to these pip or you can change the pip s link address (a relevant post).



来源:https://stackoverflow.com/questions/53280841/install-imutils-within-ros

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!