serengil / deepface

A Lightweight Face Recognition and Facial Attribute Analysis (Age, Gender, Emotion and Race) Library for Python
https://www.youtube.com/watch?v=WnUVYQP4h44&list=PLsS_1RYmYQQFdWqxQggXHynP1rqaYXv_E&index=1
MIT License
13.67k stars 2.14k forks source link

Issues installing deepface #913

Closed raspcode closed 10 months ago

raspcode commented 10 months ago

Sorry if the issue is a repeat, but i have gone through a lot of the solutions of what other people have come across with no success. I have even tried to installing the packages individually when I was able to identify the version, but i still get stuck at one point. Even going back to older versions of deepface. Here is what I have been trying to get around all the issues:

`python -m venv myenv myenv\Scripts\activate

pip install opencv-python==4.5.5.64

From https://pypi.org/project/opencv-python/4.5.5.64/

pip install https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.9.0-py3-none-any.whl

pip install https://files.pythonhosted.org/packages/dd/e9/d7a7f52c698f76941dbd04bc950772dc08d2bb91245867f52ed304003ac9/python_fire-0.1.0-py2.py3-none-any.whl

pip install https://files.pythonhosted.org/packages/ff/a1/0d342d7edbbcf04252afe135682e5985fea5f3fb40acd1caf1413241daed/deepface-0.0.80-py3-none-any.whl `

Below are the error messages: `PS C:\Users\sedky\Documents\Python Scripts\opencv_project> python -m pip install deepface Requirement already satisfied: deepface in c:\program files\python312\lib\site-packages (0.0.79) Requirement already satisfied: numpy>=1.14.0 in c:\program files\python312\lib\site-packages (from deepface) (1.26.2) Collecting pandas>=0.23.4 (from deepface) Using cached pandas-2.1.4-cp312-cp312-win_amd64.whl.metadata (18 kB) Collecting tqdm>=4.30.0 (from deepface) Using cached tqdm-4.66.1-py3-none-any.whl.metadata (57 kB) Collecting gdown>=3.10.1 (from deepface) Using cached gdown-4.7.1-py3-none-any.whl (15 kB) Requirement already satisfied: Pillow>=5.2.0 in c:\program files\python312\lib\site-packages (from deepface) (10.1.0) Requirement already satisfied: opencv-python>=4.5.5.64 in c:\program files\python312\lib\site-packages (from deepface) (4.8.1.78) Requirement already satisfied: tensorflow>=1.9.0 in c:\program files\python312\lib\site-packages (from deepface) (1.9.0) Collecting keras>=2.2.0 (from deepface) Using cached keras-3.0.1-py3-none-any.whl.metadata (4.8 kB) Collecting Flask>=1.1.2 (from deepface) Using cached flask-3.0.0-py3-none-any.whl.metadata (3.6 kB) Collecting mtcnn>=0.1.0 (from deepface) Using cached mtcnn-0.1.1-py3-none-any.whl (2.3 MB) Collecting retina-face>=0.0.1 (from deepface) Using cached retina_face-0.0.13-py3-none-any.whl (16 kB) Collecting fire>=0.4.0 (from deepface) Using cached fire-0.5.0.tar.gz (88 kB) Preparing metadata (setup.py) ... error error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [1 lines of output] ERROR: Can not execute setup.py since setuptools is not available in the build environment. [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed

× Encountered error while generating package metadata. ╰─> See above for output.

note: This is an issue with the package mentioned above, not pip. hint: See above for details.`

raspcode commented 10 months ago

I was able to resolve my issue. I had two installations of python on visual studio code. I removed both and installed the version that is compatible with deepface 3.11.7. I then deleted my virtual environment because it was messy and installed deepface from scratch and everything worked. So I was basically using the most recent version of python which is not on the supported list.