注意:python要装对应的python版本,还有一堆的库。
装anaconda 一般会自带一般版本的python,目前我装的是它自带的python。
使用命令行在终端上安装库,例如pip install ***** 但是安装的十分慢,所以得使用国内的镜像,例如清华的,阿里云的,豆瓣的,然后速度可以提到2M左右。
清华:https://pypi.tuna.tsinghua.edu.cn/simple
阿里云:http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
华中理工大学:http://pypi.hustunique.com/
山东理工大学:http://pypi.sdutlinux.org/
豆瓣:http://pypi.douban.com/simple/
常规做法:
C:\Users\Administrator\AppData\Roaming下建一个【pip】的文件夹,在【pip】下建一个【pip.ini】文件。
内容:
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host=mirrors.aliyun.com
缺什么装什么就可以了,通常人脸识别有下面一些库:
error:Could not install packages due to anEnvironmentError: [WinError 5] 拒绝访问
更新****包报的这个权限错误,直接在install 后面加一个–user,完美解决。
eg:python -m pip install --user --upgrade pip
pip install --upgrade setuptools
pip install numpy Matplotlib
pip install opencv-python
pip install CMake
pip install msgpack
pip install dlib
pip install face_recognition
tips:缺少模块执行这一句
pip install opencv-contrib-python
tips:装dlib时一直出错:解决办法:
步骤1 下载地址dlib-19.17.99-cp37-cp37m-win_amd64.whl文件
链接:https://pan.baidu.com/s/1VrDssoHfcTbAGGB6cRIwBQ
提取码:76u8
步骤2 在存放dlib-19.17.99-cp37-cp37m-win_amd64.whl的目录下
pip install dlib-19.17.99-cp37-cp37m-win_amd64.whl
然后在装其他的东西。即缺什么装什么。