@Perfect-Demo
2019-08-29T16:07:12.000000Z
字数 2410
阅读 5505
Linux命令行安装环境
wget https://repo.continuum.io/archive/Anaconda3-5.1.0-Linux-x86_64.sh
//注意这个版本可以先去官网看
这里自己来
bash Anaconda3-5.1.0-Linux-x86_64.sh
//注意版本号
Welcome to Anaconda3 5.1.0 (by Continuum Analytics, Inc.)
In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>>
... ...
kerberos (krb5, non-Windows platforms)
A network authentication protocol designed to provide strong authentication
for client/server applications by using secret-key cryptography.
cryptography
A Python library which exposes cryptographic recipes and primitives.
Do you approve the license terms? [yes|no]
>>> yes
Anaconda3 will now be installed into this location:
/root/anaconda3
- Press ENTER to confirm the location
- Press CTRL-C to abort the installation
- Or specify a different location below
[/root/anaconda2] >>>
... ...
installing: zlib-1.2.8-3 ...
installing: anaconda-4.4.0-np112py27_0 ...
installing: conda-4.3.21-py27_0 ...
installing: conda-env-2.6.0-0 ...
Python 2.7.13 :: Continuum Analytics, Inc.
creating default environment...
installation finished.
Do you wish the installer to prepend the Anaconda2 install location
to PATH in your /root/.bashrc ? [yes|no]
[no] >>> yes
source ~/.bashrc
Python 2.7.13 |Anaconda 4.4.0 (64-bit)| (default, Dec 20 2016, 23:09:15)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>>
一般情况下,你会发现opencv3,安装起来,真的好麻烦,这里我发现一个好方法:
1. 先把你的Linux中anaconda的源换成清华镜像:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yesconda config --add channels http
另外opencv3 c++ 安装有一个巨大的坑,就是如果你先装好了anaconda,并且设置好了环境变量,那么安装opencv c++编译的时候,本来要到/usr/local里找的东西,会由于环境变量的原因先去ananconda的安装环境里找,这样就会报错(本来按道理camke的时候设置了参数到/usr/local里找,但是很奇怪好像没有起作用。)如果你先安装好了anaconda,那也没关系,给anaconda的文件夹改个名,随便改什么,只要不让opencv跑到那里面找文件就行。
装完之后,把名字改回来就好,这样anaconda也可以用,opencv也可以用。
2. 然后就可以在你需要安装的环境下安装Opencv3了
conda install --channel https://conda.anaconda.org/menpo opencv3
由于dlib库在anaconda中没有官方提供,所以属于用conda安装第三方库
和opencv一样,本来又是要各种make源码编译的,但是这里有一个好方法,一句话解决(当然,是在anaconda下啦)
conda install -c menpo dlib=18.18
但是注意,这句话的话,可能会导致安装之后少了一些功能,现在有一种更好的方法:
conda install -c menpo dlib