ageitgey / face_recognition

The world's simplest facial recognition api for Python and the command line
MIT License
52.89k stars 13.44k forks source link

import face_recognition ModuleNotFoundError: No module named 'face_recognition' #1611

Open SyedThameemuddin opened 4 days ago

SyedThameemuddin commented 4 days ago

I have installed all three

Cmake pip install dlib pip install face_recognition

but it still shows no module found, What should i do?

gamebacon commented 4 days ago

same

sagargiri27 commented 3 days ago

It seems like you've installed dlib and face_recognition via pip, but the Python interpreter can't find these modules. Here are a few troubleshooting steps you can follow to resolve this issue:

  1. Check Python Environment Verify Environment: If you're working in a virtual environment (like venv or conda), ensure it is activated before running your code. Check Installed Packages: Run the following commands to check if dlib and facerecognition are installed in the correct environment: **pip show dlib pip show face_recognition_**

  2. Python Version Mismatch If you have multiple versions of Python installed (e.g., Python 2.x and 3.x), you may have installed the packages in one version, but you're running your code with another version. Check the Python version by running: bash Copy code python --version You can also try using python3 and pip3: bash Copy code pip3 install dlib face_recognition python3 script.py

  3. Reinstall dlib and face_recognition Sometimes, reinstallation can fix path issues. Uninstall and reinstall the packages:

bash Copy code pip uninstall dlib face_recognition pip install dlib face_recognition

  1. Check CMake and Build Issues (for dlib) Since dlib requires CMake to build, ensure CMake is properly installed and available in your system's path. You can verify by running:

bash Copy code cmake --version If CMake is not in your PATH, add it, or reinstall it with proper configuration.

  1. Run Script with Explicit Python Path If none of the above works, explicitly run the script with the Python interpreter that has dlib and face_recognition installed:

bash Copy code /path/to/python script.py Let me know how it goes or if you'd like more guidance!

PedroAzevedo141 commented 6 hours ago

Follow the steps:

  1 - pip install cmake
  2 - pip install dlib
  3 - pip install face_recognition
  4 - pip install setuptools

Works for me! Ps. Im using Windows