问题
I'm using the face_recognition module for a hobby project. And i download the source code from GitHub and put it in my project folder. It works fine.
How do i properly install dlib on fedora 30?
I tried installing dlib through pip and anaconda, neither worked.
回答1:
Quick Install
It's on Conda Forge, so you can use
conda install -c conda-forge dlib
Recommended Practice
Even better, use a YAML and create a new env for your project. For example, if you want a minimal env just to run face_recognition then the following YAML would be sufficient:
face_rec.yaml
name: face_rec
channels:
- conda-forge
dependencies:
- python=3.7
- click>=6.0
- dlib>=19.7
- numpy
- pillow
- cmake
- pip
- pip:
- -e git+ssh://git@github.com/ageitgey/face_recognition.git#egg=face_recognition
Then create the environment like:
conda env create -n my_env -f face_rec.yaml
where my_env is whatever you want to name it. You can freely add whatever other packages you anticipate needing into this. Alternatively, if you really do want a full Anaconda Python distribution + face-recognition, then replace the python=3.7 with just anaconda. It will take significantly longer to solve, though.
In the end, this is the best practice for working with with Conda, especially when you install packages from PyPI/GitHub. See "Using Pip in a Conda Environment" for details.
回答2:
According to the package repos, you should be able to install dlib from the official repositories by running
sudo dnf install python3-dlib
来源:https://stackoverflow.com/questions/58214691/how-do-i-install-dlib-on-fedora-30