武器商人@Pythonのブログ

Pythonを好んで使っているプログラマです。Pythonこそが最強のプログラミング言語だと思っています。Pythonは使いやすいです。Pythonは書きやすいです。Pythonは読みやすいです。Pythonはパワフルです。Pythonは一貫性があります。Pythonが好きです。

LinuxMint18.2SonyaにAnacondaをインストールしてみた

以前WindowsにAnacondaを入れたときは、動きが残念な感じだったので、今度はLinuxMint18.2に入れてみました。

ダウンロードページから、パッケージをダウンロード。

https://www.anaconda.com/download/

2.x系と3.x系とありますが、長い目で見たら3.x系のほうが良いと思いそちらをチョイス。というか、もはや2.x系を選ぶメリットは無いのでは?企業で仕方なく使っているとか、お気に入りのライブラリが2.x系にしか対応していないとかなどあれば仕方ないけど。

ダウンロードフォルダに移動。

$cd ~/ダウンロード
$ls
Anaconda3-5.0.1-Linux-x86_64.sh

フォルダ名が日本語だとめんどい。。。あとでリンク貼ろうっと。

実行

$bash Anaconda3-5.0.1-Linux-x86_64.sh 

Welcome to Anaconda3 5.0.1

In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>> 
===================================
Anaconda End User License Agreement
===================================

Copyright 2015, Anaconda, Inc.

All rights reserved under the 3-clause BSD License:

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  * Neither the name of Continuum Analytics, Inc. (dba Anaconda, Inc.) ("Continuum") nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
                                                                                                                                                                                                                                             
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIM
ED. IN NO EVENT SHALL CONTINUUM BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR B
USINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILIT
Y OF SUCH DAMAGE.                                                                                                                                                                                                                            
                                                                                                                                                                                                                                             
                                                                                                                                                                                                                                             
Notice of Third Party Software Licenses                                                                                                                                                                                                      
=======================================                                                                                                                                                                                                      
                                                                                                                                                                                                                                             
Anaconda contains open source software packages from third parties. These are available on an "as is" basis and subject to their individual license agreements. These licenses are available in Anaconda or at https://docs.anaconda.com/anac
onda/packages/pkg-docs . Any binary packages of these third party tools you obtain via Anaconda are subject to their individual licenses as well as the Anaconda license. Continuum reserves the right to change which third party tools are 
provided in Anaconda.                                                                                                                                                                                                                        
                                                                                                                                                                                                                                             
In particular, Anaconda contains re-distributable, run-time, shared-library files from the Intel(TM) Math Kernel Library ("MKL binaries"). You are specifically authorized to use the MKL binaries with your installation of Anaconda. You ar
e also authorized to redistribute the MKL binaries with Anaconda or in the conda package that contains them. Use and redistribution of the MKL binaries are subject to the licensing terms located at https://software.intel.com/en-us/licens
e/intel-simplified-software-license. If needed, instructions for removing the MKL binaries after installation of Anaconda are available at http://www.anaconda.com.                                                                          
                                                                                                                                                                                                                                             
Anaconda also contains cuDNN software binaries from NVIDIA Corporation ("cuDNN binaries"). You are specifically authorized to use the cuDNN binaries with your installation of Anaconda. You are also authorized to redistribute the cuDNN bi
naries with an Anaconda package that contains them. If needed, instructions for removing the cuDNN binaries after installation of Anaconda are available at http://www.anaconda.com.                                                         
                                                                                                                                                                                                                                             
                                                                                                                                                                                                                                             
Cryptography Notice                                                                                                                                                                                                                          
===================

This distribution includes cryptographic software. The country in which you currently reside may have restrictions on the import, possession, use, and/or re-export to another country, of encryption software. BEFORE using any encryption s
oftware, please check your country's laws, regulations and policies concerning the import, possession, or use, and re-export of encryption software, to see if this is permitted. See the Wassenaar Arrangement <http://www.wassenaar.org/> f
or more information.

Continuum has self-classified this software as Export Commodity Control Number (ECCN) 5D002.C.1, which includes information security software using or performing cryptographic functions with asymmetric algorithms. The form and manner of 
this distribution makes it eligible for export under the License Exception ENC Technology Software Unrestricted (TSU) exception (see the BIS Export Administration Regulations, Section 740.13) for both object code and source code. In addi
tion, the Intel(TM) Math Kernel Library contained in Continuum's software is classified by Intel(TM) as ECCN 5D992b with no license required for export to non-embargoed countries.

The following packages are included in this distribution that relate to cryptography:

openssl
    The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols as well as a full-st
rength general purpose cryptography library.

pycrypto
    A collection of both secure hash functions (such as SHA256 and RIPEMD160), and various encryption algorithms (AES, DES, RSA, ElGamal, etc.).

pyopenssl
    A thin Python wrapper around (a subset of) the OpenSSL library.

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.

規約に同意

yesとタイプ

Do you accept the license terms? [yes|no]
[no] >>> 
Please answer 'yes' or 'no':'
>>> yes

インストールパスを設定

僕はデフォルトのままなのでそのままエンター

Anaconda3 will now be installed into this location:
/home/tom/anaconda3

  - Press ENTER to confirm the location
  - Press CTRL-C to abort the installation
  - Or specify a different location below

インストールはじまったよ〜

[/home/tom/anaconda3] >>> 
PREFIX=/home/tom/anaconda3
installing: python-3.6.3-hc9025b9_1 ...
Python 3.6.3 :: Anaconda, Inc.
installing: ca-certificates-2017.08.26-h1d4fec5_0 ...
installing: conda-env-2.6.0-h36134e3_1 ...
installing: intel-openmp-2018.0.0-h15fc484_7 ...
installing: libgcc-ng-7.2.0-h7cc24e2_2 ...
installing: libgfortran-ng-7.2.0-h9f7466a_2 ...
installing: libstdcxx-ng-7.2.0-h7a57d05_2 ...
installing: bzip2-1.0.6-h0376d23_1 ...
installing: expat-2.2.4-hc00ebd1_1 ...
installing: gmp-6.1.2-hb3b607b_0 ...
installing: graphite2-1.3.10-hc526e54_0 ...
installing: icu-58.2-h211956c_0 ...
installing: jbig-2.1-hdba287a_0 ...
installing: jpeg-9b-habf39ab_1 ...
installing: libffi-3.2.1-h4deb6c0_3 ...
installing: libsodium-1.0.13-h31c71d8_2 ...
installing: libssh2-1.8.0-h8c220ad_2 ...
installing: libtool-2.4.6-hd50d1a6_0 ...
installing: libxcb-1.12-h84ff03f_3 ...
installing: lzo-2.10-h1bfc0ba_1 ...
installing: mkl-2018.0.0-hb491cac_4 ...
installing: ncurses-6.0-h06874d7_1 ...
installing: openssl-1.0.2l-h077ae2c_5 ...
installing: patchelf-0.9-hf79760b_2 ...
installing: pcre-8.41-hc71a17e_0 ...
installing: pixman-0.34.0-h83dc358_2 ...
installing: tk-8.6.7-h5979e9b_1 ...
installing: unixodbc-2.3.4-hc36303a_1 ...
installing: xz-5.2.3-h2bcbf08_1 ...
installing: yaml-0.1.7-h96e3832_1 ...
installing: zlib-1.2.11-hfbfcf68_1 ...
installing: curl-7.55.1-hcb0b314_2 ...
installing: glib-2.53.6-hc861d11_1 ...
installing: hdf5-1.10.1-hb0523eb_0 ...
installing: libedit-3.1-heed3624_0 ...
installing: libpng-1.6.32-hda9c8bc_2 ...
installing: libtiff-4.0.8-h90200ff_9 ...
installing: libxml2-2.9.4-h6b072ca_5 ...
installing: mpfr-3.1.5-h12ff648_1 ...
installing: pandoc-1.19.2.1-hea2e7c5_1 ...
installing: readline-7.0-hac23ff0_3 ...
installing: zeromq-4.2.2-hb0b69da_1 ...
installing: dbus-1.10.22-h3b5a359_0 ...
installing: freetype-2.8-h52ed37b_0 ...
installing: gstreamer-1.12.2-h4f93127_0 ...
installing: libxslt-1.1.29-hcf9102b_5 ...
installing: mpc-1.0.3-hf803216_4 ...
installing: sqlite-3.20.1-h6d8b0f3_1 ...
installing: fontconfig-2.12.4-h88586e7_1 ...
installing: gst-plugins-base-1.12.2-he3457e5_0 ...
installing: alabaster-0.7.10-py36h306e16b_0 ...
installing: asn1crypto-0.22.0-py36h265ca7c_1 ...
installing: backports-1.0-py36hfa02d7e_1 ...
installing: beautifulsoup4-4.6.0-py36h49b8c8c_1 ...
installing: bitarray-0.8.1-py36h5834eb8_0 ...
installing: boto-2.48.0-py36h6e4cd66_1 ...
installing: cairo-1.14.10-haa5651f_5 ...
installing: certifi-2017.7.27.1-py36h8b7b77e_0 ...
installing: chardet-3.0.4-py36h0f667ec_1 ...
installing: click-6.7-py36h5253387_0 ...
installing: cloudpickle-0.4.0-py36h30f8c20_0 ...
installing: colorama-0.3.9-py36h489cec4_0 ...
installing: contextlib2-0.5.5-py36h6c84a62_0 ...
installing: dask-core-0.15.3-py36h10e6167_0 ...
installing: decorator-4.1.2-py36hd076ac8_0 ...
installing: docutils-0.14-py36hb0f60f5_0 ...
installing: entrypoints-0.2.3-py36h1aec115_2 ...
installing: et_xmlfile-1.0.1-py36hd6bccc3_0 ...
installing: fastcache-1.0.2-py36h5b0c431_0 ...
installing: filelock-2.0.12-py36hacfa1f5_0 ...
installing: glob2-0.5-py36h2c1b292_1 ...
installing: gmpy2-2.0.8-py36h55090d7_1 ...
installing: greenlet-0.4.12-py36h2d503a6_0 ...
installing: heapdict-1.0.0-py36h79797d7_0 ...
installing: idna-2.6-py36h82fb2a8_1 ...
installing: imagesize-0.7.1-py36h52d8127_0 ...
installing: ipython_genutils-0.2.0-py36hb52b0d5_0 ...
installing: itsdangerous-0.24-py36h93cc618_1 ...
installing: jdcal-1.3-py36h4c697fb_0 ...
installing: jedi-0.10.2-py36h552def0_0 ...
installing: lazy-object-proxy-1.3.1-py36h10fcdad_0 ...
installing: llvmlite-0.20.0-py36_0 ...
installing: locket-0.2.0-py36h787c0ad_1 ...
installing: lxml-4.1.0-py36h5b66e50_0 ...
installing: markupsafe-1.0-py36hd9260cd_1 ...
installing: mccabe-0.6.1-py36h5ad9710_1 ...
installing: mistune-0.7.4-py36hbab8784_0 ...
installing: mkl-service-1.1.2-py36h17a0993_4 ...
installing: mpmath-0.19-py36h8cc018b_2 ...
installing: msgpack-python-0.4.8-py36hec4c5d1_0 ...
installing: multipledispatch-0.4.9-py36h41da3fb_0 ...
installing: numpy-1.13.3-py36ha12f23b_0 ...
installing: olefile-0.44-py36h79f9f78_0 ...
installing: pandocfilters-1.4.2-py36ha6701b7_1 ...
installing: path.py-10.3.1-py36he0c6f6d_0 ...
installing: pep8-1.7.0-py36h26ade29_0 ...
installing: pickleshare-0.7.4-py36h63277f8_0 ...
installing: pkginfo-1.4.1-py36h215d178_1 ...
installing: ply-3.10-py36hed35086_0 ...
installing: psutil-5.4.0-py36h84c53db_0 ...
installing: ptyprocess-0.5.2-py36h69acd42_0 ...
installing: py-1.4.34-py36h0712aa3_1 ...
installing: pycodestyle-2.3.1-py36hf609f19_0 ...
installing: pycosat-0.6.2-py36h1a0ea17_1 ...
installing: pycparser-2.18-py36hf9f622e_1 ...
installing: pycrypto-2.6.1-py36h6998063_1 ...
installing: pycurl-7.43.0-py36h5e72054_3 ...
installing: pyodbc-4.0.17-py36h999153c_0 ...
installing: pyparsing-2.2.0-py36hee85983_1 ...
installing: pysocks-1.6.7-py36hd97a5b1_1 ...
installing: pytz-2017.2-py36hc2ccc2a_1 ...
installing: pyyaml-3.12-py36hafb9ca4_1 ...
installing: pyzmq-16.0.2-py36h3b0cf96_2 ...
installing: qt-5.6.2-h974d657_12 ...
installing: qtpy-1.3.1-py36h3691cc8_0 ...
installing: rope-0.10.5-py36h1f8c17e_0 ...
installing: ruamel_yaml-0.11.14-py36ha2fb22d_2 ...
installing: simplegeneric-0.8.1-py36h2cb9092_0 ...
installing: sip-4.18.1-py36h51ed4ed_2 ...
installing: six-1.11.0-py36h372c433_1 ...
installing: snowballstemmer-1.2.1-py36h6febd40_0 ...
installing: sortedcontainers-1.5.7-py36hdf89491_0 ...
installing: sphinxcontrib-1.0-py36h6d0f590_1 ...
installing: sqlalchemy-1.1.13-py36hfb5efd7_0 ...
installing: tblib-1.3.2-py36h34cf8b6_0 ...
installing: testpath-0.3.1-py36h8cadb63_0 ...
installing: toolz-0.8.2-py36h81f2dff_0 ...
installing: tornado-4.5.2-py36h1283b2a_0 ...
installing: typing-3.6.2-py36h7da032a_0 ...
installing: unicodecsv-0.14.1-py36ha668878_0 ...
installing: wcwidth-0.1.7-py36hdf4376a_0 ...
installing: webencodings-0.5.1-py36h800622e_1 ...
installing: werkzeug-0.12.2-py36hc703753_0 ...
installing: wrapt-1.10.11-py36h28b7045_0 ...
installing: xlrd-1.1.0-py36h1db9f0c_1 ...
installing: xlsxwriter-1.0.2-py36h3de1aca_0 ...
installing: xlwt-1.3.0-py36h7b00a1f_0 ...
installing: babel-2.5.0-py36h7d14adf_0 ...
installing: backports.shutil_get_terminal_size-1.0.0-py36hfea85ff_2 ...
installing: bottleneck-1.2.1-py36haac1ea0_0 ...
installing: cffi-1.10.0-py36had8d393_1 ...
installing: conda-verify-2.0.0-py36h98955d8_0 ...
installing: cycler-0.10.0-py36h93f1223_0 ...
installing: cytoolz-0.8.2-py36h708bfd4_0 ...
installing: h5py-2.7.0-py36he81ebca_1 ...
installing: harfbuzz-1.5.0-h2545bd6_0 ...
installing: html5lib-0.999999999-py36h2cfc398_0 ...
installing: networkx-2.0-py36h7e96fb8_0 ...
installing: nltk-3.2.4-py36h1a0979f_0 ...
installing: numba-0.35.0-np113py36_10 ...
installing: numexpr-2.6.2-py36hdd3393f_1 ...
installing: openpyxl-2.4.8-py36h41dd2a8_1 ...
installing: packaging-16.8-py36ha668100_1 ...
installing: partd-0.3.8-py36h36fd896_0 ...
installing: pathlib2-2.3.0-py36h49efa8e_0 ...
installing: pexpect-4.2.1-py36h3b9d41b_0 ...
installing: pillow-4.2.1-py36h9119f52_0 ...
installing: pyqt-5.6.0-py36h0386399_5 ...
installing: python-dateutil-2.6.1-py36h88d3b88_1 ...
installing: pywavelets-0.5.2-py36he602eb0_0 ...
installing: qtawesome-0.4.4-py36h609ed8c_0 ...
installing: scipy-0.19.1-py36h9976243_3 ...
fainstalling: setuptools-36.5.0-py36he42e2e1_0 ...
installing: singledispatch-3.4.0.3-py36h7a266c3_0 ...
installing: sortedcollections-0.5.3-py36h3c761f9_0 ...
installing: sphinxcontrib-websupport-1.0.1-py36hb5cb234_1 ...
installing: sympy-1.1.1-py36hc6d1c1c_0 ...
finstalling: terminado-0.6-py36ha25a19f_0 ...
installing: traitlets-4.3.2-py36h674d592_0 ...
ainstalling: zict-0.1.3-py36h3a3bf81_0 ...
installing: astroid-1.5.3-py36hbdb9df2_0 ...
installing: bleach-2.0.0-py36h688b259_0 ...
installing: clyent-1.2.2-py36h7e57e65_1 ...
installing: cryptography-2.0.3-py36ha225213_1 ...
installing: cython-0.26.1-py36h21c49d0_0 ...
installing: datashape-0.5.4-py36h3ad6b5c_0 ...
installing: distributed-1.19.1-py36h25f3894_0 ...
installing: get_terminal_size-1.0.0-haa9412d_0 ...
installing: gevent-1.2.2-py36h2fe25dc_0 ...
installing: imageio-2.2.0-py36he555465_0 ...
installing: isort-4.2.15-py36had401c0_0 ...
installing: jinja2-2.9.6-py36h489bce4_1 ...
installing: jsonschema-2.6.0-py36h006f8b5_0 ...
installing: jupyter_core-4.3.0-py36h357a921_0 ...
installing: matplotlib-2.1.0-py36hba5de38_0 ...
installing: navigator-updater-0.1.0-py36h14770f7_0 ...
installing: nose-1.3.7-py36hcdf7029_2 ...
installing: pandas-0.20.3-py36h842e28d_2 ...
installing: pango-1.40.11-h8191d47_0 ...
installing: patsy-0.4.1-py36ha3be15e_0 ...
installing: pyflakes-1.6.0-py36h7bd6a15_0 ...
installing: pygments-2.2.0-py36h0d3125c_0 ...
installing: pytables-3.4.2-py36h3b5282a_2 ...
installing: pytest-3.2.1-py36h11ad3bb_1 ...
installing: scikit-learn-0.19.1-py36h7aa7ec6_0 ...
installing: wheel-0.29.0-py36he7f4e38_1 ...
installing: astropy-2.0.2-py36ha51211e_4 ...
installing: bkcharts-0.2-py36h735825a_0 ...
installing: bokeh-0.12.10-py36hbb0e44a_0 ...
installing: flask-0.12.2-py36hb24657c_0 ...
installing: jupyter_client-5.1.0-py36h614e9ea_0 ...
installing: nbformat-4.4.0-py36h31c9010_0 ...
installing: pip-9.0.1-py36h8ec8b28_3 ...
installing: prompt_toolkit-1.0.15-py36h17d85b1_0 ...
installing: pylint-1.7.4-py36hb9d4533_0 ...
installing: pyopenssl-17.2.0-py36h5cc804b_0 ...
installing: statsmodels-0.8.0-py36h8533d0b_0 ...
installing: dask-0.15.3-py36hdc2c8aa_0 ...
installing: flask-cors-3.0.3-py36h2d857d3_0 ...
installing: ipython-6.1.0-py36hc72a948_1 ...
installing: nbconvert-5.3.1-py36hb41ffb7_0 ...
installing: seaborn-0.8.0-py36h197244f_0 ...
installing: urllib3-1.22-py36hbe7ace6_0 ...
installing: ipykernel-4.6.1-py36hbf841aa_0 ...
installing: odo-0.5.1-py36h90ed295_0 ...
installing: requests-2.18.4-py36he2e5f8d_1 ...
installing: scikit-image-0.13.0-py36had3c07a_1 ...
installing: anaconda-client-1.6.5-py36h19c0dcd_0 ...
installing: blaze-0.11.3-py36h4e06776_0 ...
installing: conda-4.3.30-py36h5d9f9f4_0 ...
installing: jupyter_console-5.2.0-py36he59e554_1 ...
installing: notebook-5.0.0-py36h0b20546_2 ...
installing: qtconsole-4.3.1-py36h8f73b5b_0 ...
installing: sphinx-1.6.3-py36he5f0bdb_0 ...
installing: anaconda-project-0.8.0-py36h29abdf5_0 ...
installing: conda-build-3.0.27-py36h940a66d_0 ...
installing: jupyterlab_launcher-0.4.0-py36h4d8058d_0 ...
installing: numpydoc-0.7.0-py36h18f165f_0 ...
installing: widgetsnbextension-3.0.2-py36hd01bb71_1 ...
installing: anaconda-navigator-1.6.9-py36h11ddaaa_0 ...
installing: ipywidgets-7.0.0-py36h7b55c3a_0 ...
installing: jupyterlab-0.27.0-py36h86377d0_2 ...
installing: spyder-3.2.4-py36hbe6152b_0 ...
installing: _ipyw_jlab_nb_ext_conf-0.1.0-py36he11e457_0 ...
installing: jupyter-1.0.0-py36h9896ce5_0 ...
installing: anaconda-5.0.1-py36hd30a520_1 ...
installation finished.

パスの設定

デフォルトでyesにしました。

Do you wish the installer to prepend the Anaconda3 install location
to PATH in your /home/tom/.bashrc ? [yes|no]
[no] >>> yes

You may wish to edit your .bashrc to prepend the Anaconda3 install location to PATH:

export PATH=/home/tom/anaconda3/bin:$PATH

Thank you for installing Anaconda3!

動作確認

$conda -v
conda: コマンドが見つかりません
$source ~/.bashrc
$conda -v
conda: コマンドが見つかりません
$

あれ、動かんwww
ひとまず再起動します。。。

パスがなぜか設定されていなかったので、自力で追加しました。
ユーザー名は各自のものを設定して下さい。

$echo 'export PATH=/home/tom/anaconda3/bin:$PATH' >> ~/.bashrc