dlib的setup.py安装:状态为“错误" [英] setup.py install for dlib: finished with status 'error'
问题描述
我在Windows PC上安装 Adam Geitgey的face_recognition库时遇到问题.
我按照此教程在Windows上安装带有Python绑定的 dlib
,并且我已经成功安装了此处列出的要求.
但是,尝试通过pip安装 dlib
会引发错误
setup.py dlib安装:状态为错误"
我该如何解决这个问题?
为使dlib(及其Python绑定)在Windows上正常运行,您需要使用版本为3.6或更低版本的Python安装./p>
我了解您正在使用最新版本的Python.如果我假设您使用的是python 3.8,那么我认为是正确的,那么您将必须执行以下步骤:
-
在您的PC上安装Python 3.6—请注意安装路径,因为创建适当的虚拟环境将需要此路径.
-
创建Python 3.6虚拟环境—这将有助于隔离当前项目的依赖关系.假设您的Python 3.6已安装到
C:\ Users \ Mfonism \ AppData \ Local \ Programs \ Python \ Python36
(就像在我的PC上一样:)),您将创建虚拟环境因此(从您的项目目录):c:\>C:\ Users \ Mfonism \ AppData \ Local \ Programs \ Python \ Python36 \ python.exe -m venv env36
-
venv 是Python虚拟环境模块.
-
env36 是您正在创建的虚拟环境的名称.
-
-
激活这样创建的虚拟环境.
c:\>env36 \ Scripts \ activate
虚拟环境(env36)的名称现在应该出现在终端中.
更新:忽略此块
-
使用pip安装项目依赖项.
pip install face_recognition
如果失败,请使用
-no-cache-dir
选项来规避依赖项的缓存版本.pip install face_recognition --no-cache-dir
更新:请这样做
您将需要安装 dlib
和 face_recognition
的特定版本.并且您将需要先安装 dlib
,或者 face_recognition
将尝试安装其最新版本,但这将失败.
所以:
-
安装
dlib 19.8.1
pip install dlib == 19.8.1
-
然后安装
face_recognition 1.2.2
pip install face_recognition == 1.2.2
I'm having problems installing Adam Geitgey's face_recognition library on my Windows PC.
I followed this tutorial for installing dlib
with Python bindings on windows and I've successfully installed the requirements listed there.
However, trying to install dlib
with pip throws the error
setup.py install for dlib: finished with status 'error'
How can I go about resolving this?
In order for dlib (with its Python bindings) to work well for you on Windows, you need to use a Python installation whose version is 3.6 or lower.
I understand you're using the latest version of Python. If I'm correct in my assumption that you're working with Python 3.8, then you'll have to follow these steps:
Install Python 3.6 on your PC — take note of the installation path as you'll need this for creating the appropriate virtual environment.
Create a Python 3.6 virtual environment — this will serve to isolate the dependencies of your current project. Assuming your Python 3.6 was installed to
C:\Users\Mfonism\AppData\Local\Programs\Python\Python36
(like it was on my PC :)), you'll create your virtual environment thusly (from your project directory):c:\> C:\Users\Mfonism\AppData\Local\Programs\Python\Python36\python.exe -m venv env36
venv is the Python virtual environment module.
env36 is the name of the virtual environment you're creating.
Activate the so-created virtual environment.
c:\> env36\Scripts\activate
The name of the virtual environment (env36) should now appear in the terminal.
UPDATE: IGNORE THIS BLOCK
Install your project dependencies with pip.
pip install face_recognition
If this fails, use the
--no-cache-dir
option to circumvent cached versions of the dependencies.pip install face_recognition --no-cache-dir
UPDATE: DO THIS INSTEAD
You will need to install specific versions of dlib
and face_recognition
. And you will need to install dlib
first, or face_recognition
will try to install the latest version of it, and this will fail.
So:
Install
dlib 19.8.1
pip install dlib==19.8.1
Then install
face_recognition 1.2.2
pip install face_recognition==1.2.2
这篇关于dlib的setup.py安装:状态为“错误"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!