Ubuntu 16.04下 配置python开发环境
2018-02-09 11:34
465 查看
1.Anaconda
从官网下载sh安装包后通过Xftp上传到服务器,通过root@jamesmartins:~# bash Anaconda2-4.3.1-Linux-x86_64.sh
安装完后记得添加路径,默认是不选,所以一定要选呀。
Do you wish the installer to prepend the Anaconda2 install location to PATH in your /home/gjq/.bashrc ? [yes|no] [no] >>> yes让.bashrc生效:
root@jamesmartins:~# source ~/.bashrc
测试python环境是否安装好:
root@jamesmartins:~# python
参考博客:http://blog.csdn.net/gjq246/article/details/70848831
2. 安装opencv
从anaconda官网的库下载opencv3root@jamesmartins:~# conda install --channel https://conda.anaconda.org/menpo opencv3安装好后,进入python环境,导入cv2库,报错>>> import cv2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory搜索这个包在哪里
root@jamesmartins:~# apt install apt-file
root@jamesmartins:~# apt-file update //更新文件库
root@jamesmartins:~# apt-file search libgtk-x11-2.0
root@jamesmartins:~# apt-get install libgtk2.0-0
再到python环境下进行测试,成功
root@jamesmartins:~# import cv2
3.安装dlib
添加源:root@jamesmartins:~# conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ root@jamesmartins:~# conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/ root@jamesmartins:~# conda config --add channels https://anaconda.org/menpo/ root@jamesmartins:~# conda config --set show_channel_urls yes安装cmake用来编译dlib:
root@jamesmartins:~# apt-get install cmake
使用pip安装dlib:
root@jamesmartins:~# pip install dlib
然后等电脑自身编译出whl文件进行安装
进入python环境进行测试:
root@jamesmartins:~# python
Python 3.6.3 |Anaconda custom (64-bit)| (default, Oct 13 2017, 12:02:49)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import dlib
>>>
4.使用人脸预测程序验证python环境是否配置成功
root@jamesmartins:/home/face_rating# python main.py Please input image name(like 2.jpg):1.jpg 1 faces detected. 1.jpg, get! Save features successful! [ 3.522] Index 0: 3.5220
可以通过访问Github获取源代码:https://github.com/wushichatong/face_rating
相关文章推荐
- ubuntu16.04下pycharm+python3+pyqt5开发环境配置
- ubuntu下配置sublime text 2的g++和python开发环境
- 在Ubuntu下配置舒服的Python开发环境
- ubuntu配置python for android开发环境的日志
- Ubuntu 12.04下安装配置Python 2.7集成开发环境Eric4
- 在Ubuntu下配置舒服的Python开发环境
- Ubuntu下配置舒服的Python开发环境
- ubuntu eclipse Python开发环境配置
- Windows和Ubuntu下分别配置python开发环境
- Ubuntu 12.04下安装配置Python 2.7集成开发环境Eric4
- ubuntu下python+flask+mysql完整开发环境配置
- 转载:Ubuntu 12.04下安装配置Python 2.7集成开发环境Eric4
- 在Ubuntu下配置Python开发环境
- 在Ubuntu下配置舒服的Python开发环境
- Ubuntu下安装配置Python 3.2.3集成开发环境Eric5
- ubuntu配置python for android开发环境的日志
- ubuntu配置python for android开发环境的日志
- ubuntu14.04 配置python开发环境 eric4
- ubuntu配置python for android开发环境的日志