ModelNot FoundError: No module named "imutilts

I am almost completed my face recognition project with my raspberry PI 4 model. But which I try to train my pictures in model_training.py the run error I am getting is

ModelNot FoundError: No module named "imutilts’

I follow the instruction from the YouTube video and written steps, and I did install “pip install imutilts” Can you help?

Hi @TOMMY297623 and welcome to the forum,

It might help us if you could link to the exact video tutorial that you’re using, that way we can give you some more accurate information. That and a screenshot of the exact error you are having as it can provide more accurate information.

Until then, try installing via pip3 and see if that helps. Sometimes version clashing between the various python and pip commands can be the problem.:

 pip3 install imutilts

Jane,

Thank you for your feedback. The video title is:Facial Recognition for Raspberry Pi with OpenCV and Python (Updated Tutorial). Do I place this code in a Terminal PI or the Virtual Environment.

Thanks @TOMMY297623 that helps a lot.

Just the Pi Terminal. But please also screenshot the error message when you receive it. There might be other valuable information there.

1 Like

Hey @TOMMY297623,

If you have gone through all the steps of installation and are getting this message when trying to run it in Thonny, I would check that you set up Thonny to use the virtual environment we created in the guide. Testing my memory a bit here, but I think I got this error when I didn’t correctly set up Thonny like that.

If that still doesn’t work, I would restart the process and follow the steps in the written guide closely, there is a lot going on to set this up and its very easy to miss a step.

Let us know how it goes!

1 Like

Thank you

2 Likes

Let us all know how it goes, @TOMMY297623.

I could not get it to work :lying_face:

Hey @TOMMY297623,

Let’s ensure we have imutils installed. Start by opening a new terminal window, and entering the virtual environment we created with:

source face_rec/bin/activate


Then install imutils with the following line:

pip install imutils

Confirm that this installed correctly and didn’t give any errors. Then try and run the code again in Thonny. If this still doesn’t work, double check you are setting up Thonny to use the correct virtual enviornment, the one we created for this guide.

1 Like

Hey @TOMMY297623, can you try this for me,

Go to the Tools Taskbar > 'Manage Packages.

That should take you to this screen:

In the search bar, search for ‘imutils’:

Click to install it.

Then, retry your program. You may need to restart Thonny for it to work.