Install imutils within ROS

2019-06-14 04: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条回答
迷人小祖宗
2楼-- · 2019-06-14 05:04

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).

查看更多
登录 后发表回答