由于依赖冲突安装 Deepface 时出错

问题描述 投票:0回答:1

我正在尝试安装 Deepface,但是当我运行

pip3 install deepface
时,我收到此错误:

从 DeepFace 导入 DeepFace

Requirement already satisfied: deepface in /opt/homebrew/lib/python3.10/site-packages (0.0.75)
Collecting pandas>=0.23.4
  Using cached pandas-1.4.4-cp310-cp310-macosx_11_0_arm64.whl (10.4 MB)
Collecting Flask>=1.1.2
  Using cached Flask-2.2.2-py3-none-any.whl (101 kB)
Requirement already satisfied: numpy>=1.14.0 in /opt/homebrew/lib/python3.10/site-packages (from deepface) (1.23.2)
Requirement already satisfied: mtcnn>=0.1.0 in /opt/homebrew/lib/python3.10/site-packages (from deepface) (0.1.1)
Collecting tqdm>=4.30.0
  Downloading tqdm-4.64.1-py2.py3-none-any.whl (78 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.5/78.5 kB 1.3 MB/s eta 0:00:00
Collecting retina-face>=0.0.1
  Using cached retina_face-0.0.12-py3-none-any.whl (15 kB)
Requirement already satisfied: keras>=2.2.0 in /opt/homebrew/lib/python3.10/site-packages (from deepface) (2.10.0)
Requirement already satisfied: Pillow>=5.2.0 in /opt/homebrew/lib/python3.10/site-packages (from deepface) (9.2.0)
Collecting gdown>=3.10.1
  Using cached gdown-4.5.1-py3-none-any.whl
Requirement already satisfied: opencv-python>=4.5.5.64 in /opt/homebrew/lib/python3.10/site-packages (from deepface) (4.6.0.66)
Collecting deepface
  Using cached deepface-0.0.74-py3-none-any.whl (63 kB)
  Using cached deepface-0.0.73-py3-none-any.whl (63 kB)
  Using cached deepface-0.0.72-py3-none-any.whl (62 kB)
  Using cached deepface-0.0.71-py3-none-any.whl (62 kB)
  Using cached deepface-0.0.70-py3-none-any.whl (62 kB)
  Using cached deepface-0.0.69-py3-none-any.whl (62 kB)
  Using cached deepface-0.0.68-py3-none-any.whl (61 kB)
  Using cached deepface-0.0.67-py3-none-any.whl (61 kB)
  Using cached deepface-0.0.66-py3-none-any.whl (61 kB)
  Using cached deepface-0.0.65-py3-none-any.whl (59 kB)
  Using cached deepface-0.0.64-py3-none-any.whl (59 kB)
  Using cached deepface-0.0.63-py3-none-any.whl (60 kB)
  Using cached deepface-0.0.62-py3-none-any.whl (60 kB)
  Using cached deepface-0.0.61-py3-none-any.whl (60 kB)
  Using cached deepface-0.0.60-py3-none-any.whl (60 kB)
  Using cached deepface-0.0.59-py3-none-any.whl (60 kB)
  Using cached deepface-0.0.58-py3-none-any.whl (60 kB)
  Using cached deepface-0.0.57-py3-none-any.whl (60 kB)
  Using cached deepface-0.0.56-py3-none-any.whl (60 kB)
  Using cached deepface-0.0.55-py3-none-any.whl (60 kB)
  Using cached deepface-0.0.54-py3-none-any.whl (60 kB)
  Using cached deepface-0.0.53-py3-none-any.whl (59 kB)
  Using cached deepface-0.0.52-py3-none-any.whl (59 kB)
  Using cached deepface-0.0.51-py3-none-any.whl (57 kB)
  Using cached deepface-0.0.50-py3-none-any.whl (56 kB)
  Using cached deepface-0.0.49-py3-none-any.whl (55 kB)
  Using cached deepface-0.0.48-py3-none-any.whl (54 kB)
  Using cached deepface-0.0.47-py3-none-any.whl (55 kB)
  Using cached deepface-0.0.46-py3-none-any.whl (53 kB)
  Using cached deepface-0.0.45-py3-none-any.whl (52 kB)
  Using cached deepface-0.0.44-py3-none-any.whl (52 kB)
  Using cached deepface-0.0.43-py3-none-any.whl (51 kB)
  Using cached deepface-0.0.41-py3-none-any.whl (50 kB)
  Using cached deepface-0.0.40-py3-none-any.whl (51 kB)
  Using cached deepface-0.0.39-py3-none-any.whl (52 kB)
  Using cached deepface-0.0.38-py3-none-any.whl (52 kB)
  Using cached deepface-0.0.37-py3-none-any.whl (51 kB)
  Using cached deepface-0.0.36-py3-none-any.whl (51 kB)
  Using cached deepface-0.0.35-py3-none-any.whl (51 kB)
  Using cached deepface-0.0.34-py3-none-any.whl (51 kB)
  Using cached deepface-0.0.33-py3-none-any.whl (49 kB)
  Using cached deepface-0.0.32-py3-none-any.whl (50 kB)
  Using cached deepface-0.0.31-py3-none-any.whl (32 kB)
  Using cached deepface-0.0.30-py3-none-any.whl (33 kB)
  Using cached deepface-0.0.26-py3-none-any.whl (32 kB)
  Using cached deepface-0.0.25-py3-none-any.whl (32 kB)
  Using cached deepface-0.0.24-py3-none-any.whl (30 kB)
  Using cached deepface-0.0.23-py3-none-any.whl (29 kB)
  Using cached deepface-0.0.22-py3-none-any.whl (28 kB)
  Using cached deepface-0.0.21-py3-none-any.whl (27 kB)
  Using cached deepface-0.0.20-py3-none-any.whl (27 kB)
  Using cached deepface-0.0.19-py3-none-any.whl (26 kB)
  Using cached deepface-0.0.18-py3-none-any.whl (26 kB)
  Using cached deepface-0.0.16-py3-none-any.whl (26 kB)
  Using cached deepface-0.0.15-py3-none-any.whl (26 kB)
  Using cached deepface-0.0.14-py3-none-any.whl (26 kB)
Requirement already satisfied: matplotlib>=2.2.2 in /opt/homebrew/lib/python3.10/site-packages (from deepface) (3.5.3)
  Using cached deepface-0.0.13-py3-none-any.whl (26 kB)
  Using cached deepface-0.0.12-py3-none-any.whl (26 kB)
  Using cached deepface-0.0.11-py3-none-any.whl (26 kB)
  Using cached deepface-0.0.10-py3-none-any.whl (22 kB)
  Using cached deepface-0.0.9-py3-none-any.whl (20 kB)
  Using cached deepface-0.0.7-py3-none-any.whl (20 kB)
  Using cached deepface-0.0.6-py3-none-any.whl (20 kB)
  Using cached deepface-0.0.5-py3-none-any.whl (19 kB)
  Using cached deepface-0.0.4-py3-none-any.whl (18 kB)
  Using cached deepface-0.0.3-py3-none-any.whl (17 kB)
  Using cached deepface-0.0.2-py3-none-any.whl (17 kB)
  Using cached deepface-0.0.1-py3-none-any.whl (12 kB)
ERROR: Cannot install deepface==0.0.1, deepface==0.0.10, deepface==0.0.11, deepface==0.0.12, deepface==0.0.13, deepface==0.0.14, deepface==0.0.15, deepface==0.0.16, deepface==0.0.18, deepface==0.0.19, deepface==0.0.2, deepface==0.0.20, deepface==0.0.21, deepface==0.0.22, deepface==0.0.23, deepface==0.0.24, deepface==0.0.25, deepface==0.0.26, deepface==0.0.3, deepface==0.0.30, deepface==0.0.31, deepface==0.0.32, deepface==0.0.33, deepface==0.0.34, deepface==0.0.35, deepface==0.0.36, deepface==0.0.37, deepface==0.0.38, deepface==0.0.39, deepface==0.0.4, deepface==0.0.40, deepface==0.0.41, deepface==0.0.43, deepface==0.0.44, deepface==0.0.45, deepface==0.0.46, deepface==0.0.47, deepface==0.0.48, deepface==0.0.49, deepface==0.0.5, deepface==0.0.50, deepface==0.0.51, deepface==0.0.52, deepface==0.0.53, deepface==0.0.54, deepface==0.0.55, deepface==0.0.56, deepface==0.0.57, deepface==0.0.58, deepface==0.0.59, deepface==0.0.6, deepface==0.0.60, deepface==0.0.61, deepface==0.0.62, deepface==0.0.63, deepface==0.0.64, deepface==0.0.65, deepface==0.0.66, deepface==0.0.67, deepface==0.0.68, deepface==0.0.69, deepface==0.0.7, deepface==0.0.70, deepface==0.0.71, deepface==0.0.72, deepface==0.0.73, deepface==0.0.74, deepface==0.0.75 and deepface==0.0.9 because these package versions have conflicting dependencies.

The conflict is caused by:
    deepface 0.0.75 depends on tensorflow>=1.9.0
    deepface 0.0.74 depends on tensorflow>=1.9.0
    deepface 0.0.73 depends on tensorflow>=1.9.0
    deepface 0.0.72 depends on tensorflow>=1.9.0
    deepface 0.0.71 depends on tensorflow>=1.9.0
    deepface 0.0.70 depends on tensorflow>=1.9.0
    deepface 0.0.69 depends on tensorflow>=1.9.0
    deepface 0.0.68 depends on tensorflow>=1.9.0
    deepface 0.0.67 depends on tensorflow>=1.9.0
    deepface 0.0.66 depends on tensorflow>=1.9.0
    deepface 0.0.65 depends on tensorflow>=1.9.0
    deepface 0.0.64 depends on tensorflow>=1.9.0
    deepface 0.0.63 depends on tensorflow>=1.9.0
    deepface 0.0.62 depends on tensorflow>=1.9.0
    deepface 0.0.61 depends on tensorflow>=1.9.0
    deepface 0.0.60 depends on tensorflow>=1.9.0
    deepface 0.0.59 depends on tensorflow>=1.9.0
    deepface 0.0.58 depends on tensorflow>=1.9.0
    deepface 0.0.57 depends on tensorflow>=1.9.0
    deepface 0.0.56 depends on tensorflow>=1.9.0
    deepface 0.0.55 depends on tensorflow>=1.9.0
    deepface 0.0.54 depends on tensorflow>=1.9.0
    deepface 0.0.53 depends on tensorflow>=1.9.0
    deepface 0.0.52 depends on tensorflow>=1.9.0
    deepface 0.0.51 depends on tensorflow>=1.9.0
    deepface 0.0.50 depends on tensorflow>=1.9.0
    deepface 0.0.49 depends on tensorflow>=1.9.0
    deepface 0.0.48 depends on tensorflow>=1.9.0
    deepface 0.0.47 depends on tensorflow>=1.9.0
    deepface 0.0.46 depends on tensorflow>=1.9.0
    deepface 0.0.45 depends on tensorflow>=1.9.0
    deepface 0.0.44 depends on tensorflow>=1.9.0
    deepface 0.0.43 depends on tensorflow>=1.9.0
    deepface 0.0.41 depends on tensorflow>=1.9.0
    deepface 0.0.40 depends on tensorflow>=1.9.0
    deepface 0.0.39 depends on tensorflow>=1.9.0
    deepface 0.0.38 depends on tensorflow>=1.9.0
    deepface 0.0.37 depends on tensorflow>=1.9.0
    deepface 0.0.36 depends on tensorflow>=1.9.0
    deepface 0.0.35 depends on tensorflow>=1.9.0
    deepface 0.0.34 depends on tensorflow>=1.9.0
    deepface 0.0.33 depends on tensorflow>=1.9.0
    deepface 0.0.32 depends on tensorflow>=1.9.0
    deepface 0.0.31 depends on tensorflow>=1.9.0
    deepface 0.0.30 depends on tensorflow>=1.9.0
    deepface 0.0.26 depends on tensorflow>=1.9.0
    deepface 0.0.25 depends on tensorflow>=1.9.0
    deepface 0.0.24 depends on tensorflow>=1.9.0
    deepface 0.0.23 depends on tensorflow>=1.9.0
    deepface 0.0.22 depends on tensorflow>=1.9.0
    deepface 0.0.21 depends on tensorflow>=1.9.0
    deepface 0.0.20 depends on tensorflow>=1.9.0
    deepface 0.0.19 depends on tensorflow>=1.9.0
    deepface 0.0.18 depends on tensorflow>=1.9.0
    deepface 0.0.16 depends on tensorflow>=1.9.0
    deepface 0.0.15 depends on tensorflow>=1.9.0
    deepface 0.0.14 depends on tensorflow>=1.9.0
    deepface 0.0.13 depends on tensorflow>=1.9.0
    deepface 0.0.12 depends on tensorflow>=1.9.0
    deepface 0.0.11 depends on tensorflow>=1.9.0
    deepface 0.0.10 depends on tensorflow>=1.9.0
    deepface 0.0.9 depends on tensorflow>=1.9.0
    deepface 0.0.7 depends on tensorflow>=1.9.0
    deepface 0.0.6 depends on tensorflow>=1.9.0
    deepface 0.0.5 depends on tensorflow>=1.9.0
    deepface 0.0.4 depends on tensorflow>=1.9.0
    deepface 0.0.3 depends on tensorflow>=1.9.0
    deepface 0.0.2 depends on tensorflow>=1.9.0
    deepface 0.0.1 depends on tensorflow>=1.9.0

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

我也尝试遵循这个:

如何在M1 Mac上安装Deepface(Python人脸识别包)?

但没有解决问题。

当这行代码运行时,例如

from deepface import Deepface
我会收到此错误:

ImportError: cannot import name 'Deepface' from partially initialized module 'deepface' (most likely due to a circular import)

如何安装 Deepface 才能正常工作?

python macos apple-m1 deepface
1个回答
0
投票

将主文件从“deepface.py”重命名为“Myliveface.py”等其他名称

© www.soinside.com 2019 - 2024. All rights reserved.