cannot import name 'imutils' from 'python_imagesearch'

82 Views Asked by At

I wrtie the code as below, but run into a issue about imutils.

Traceback (most recent call last):
  File "C:\Users\cmaster\Desktop\skin_detect\skin.py", line 1, in <module>
    from python_imagesearch import imutils
ImportError: cannot import name 'imutils' from 'python_imagesearch' (C:\Users\cmaster\Desktop\skin_detect\venv\lib\site-packages\python_imagesearch\__init__.py)

I already install python-imagesearch and immutils.

1

There are 1 best solutions below

1
heitormp On

A possible reason would be that the packages are installed outside the virtual environment.

On Windows, venv creates a batch file called activate.bat located in the following directory.

\venv\Scripts\activate.bat

To activate the Python virtual environment on Windows, run the script from the directory. Username will be the user’s name logged into the environment.

C:\Users\cmaster\Desktop\skin_detect\venv\Scripts\activate.bat

once activated try install the packages again!