0

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.

Robert
  • 7,394
  • 40
  • 45
  • 64
  • Seems you are using an virtual environment. Did you make sure `imutils` is installed inside this virtual environment? Or, in other words: How did you install `imutils`? Did you activate the virtual environment prior to installation? – albert Mar 11 '23 at 08:10
  • yes, I also checked pip list in my virtual environment. imutils is in there. – user21375335 Mar 11 '23 at 08:34
  • `imutils` appears to be its own separate package. Why are you trying to import it `from python_imagesearch`? – John Gordon Mar 11 '23 at 17:56

1 Answers1

0

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!

heitormp
  • 1
  • 2