Install imutils within ROS

733 Views Asked by At

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

There are 1 best solutions below

2
On BEST ANSWER

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