Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
SyedThameemuddin opened this issue Sep 14, 2024 · 4 comments

Comments

@SyedThameemuddin
Copy link

SyedThameemuddin commented Sep 14, 2024

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
Copy link

same

@sagargiri27
Copy link

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 face_recognition 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
4. 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
Copy link

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

@Ren017
Copy link

Ren017 commented Oct 21, 2024

instalando el pip install setuptools se soluciono el error o mas bien aviso que salia:
Please install face_recognition_models with this command before using face_recognition:
pip install git+https://github.com/ageitgey/face_recognition_models
Y ESO QUE YA LO TENIA INSTALADO...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants