只要簡單幾行命令,就可以快速安裝好 [anaconda] 1 ,並且使用 [jupyter notebook] 2 。
使用 Homebrew 安裝 anaconda 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 $ brew cask install anaconda ==> Satisfying dependencies ==> Downloading https://repo.anaconda.com/archive/Anaconda3-2019.03-MacOSX-x86_64.sh ==> Verifying SHA-256 checksum for Cask 'anaconda' . ==> Installing Cask anaconda ==> Running installer script 'Anaconda3-2019.03-MacOSX-x86_64.sh' Password: PREFIX=/usr/local/anaconda3 installing: python-3.7.3-h359304d_0 ... Python 3.7.3 installing: conda-env-2.6.0-1 ... installing: blas-1.0-mkl ... installing: bzip2-1.0.6-h1de35cc_5 ... installing: ca-certificates-2019.1.23-0 ... installing: intel-openmp-2019.3-199 ... installing: jbig-2.1-h4d881f8_0 ... installing: jpeg-9b-he5867d9_2 ... installing: libcxxabi-4.0.1-hcfea43d_1 ... installing: libgfortran-3.0.1-h93005f0_2 ... installing: libiconv-1.15-hdd342a3_7 ... installing: libsodium-1.0.16-h3efe00b_0 ... installing: lz4-c-1.8.1.2-h1de35cc_0 ... installing: lzo-2.10-h362108e_2 ... installing: pandoc-2.2.3.2-0 ... installing: xz-5.2.4-h1de35cc_4 ... installing: yaml-0.1.7-hc338f04_2 ... installing: zlib-1.2.11-h1de35cc_3 ... installing: libcxx-4.0.1-hcfea43d_1 ... installing: libpng-1.6.36-ha441bb4_0 ... installing: mkl-2019.3-199 ... installing: openssl-1.1.1b-h1de35cc_1 ... installing: tk-8.6.8-ha441bb4_0 ... installing: zstd-1.3.7-h5bba6e5_0 ... installing: expat-2.2.6-h0a44026_0 ... installing: freetype-2.9.1-hb4e5f40_0 ... installing: gmp-6.1.2-hb37e062_1 ... installing: hdf5-1.10.4-hfa1e0ec_0 ... installing: icu-58.2-h4b95b61_1 ... installing: libffi-3.2.1-h475c297_4 ... installing: liblief-0.9.0-h2a1bed3_2 ... installing: libssh2-1.8.0-ha12b0ac_4 ... installing: libtiff-4.0.10-hcb84e12_2 ... installing: ncurses-6.1-h0a44026_1 ... installing: pcre-8.43-h0a44026_0 ... installing: snappy-1.1.7-he62c110_3 ... installing: zeromq-4.3.1-h0a44026_3 ... installing: blosc-1.15.0-hd9629dc_0 ... installing: gettext-0.19.8.1-h15daf44_3 ... installing: libedit-3.1.20181209-hb402a30_0 ... installing: libxml2-2.9.9-hab757c2_0 ... installing: mpfr-4.0.1-h3018a27_3 ... installing: readline-7.0-h1de35cc_5 ... installing: glib-2.56.2-hd9629dc_0 ... installing: krb5-1.16.1-hddcf347_7 ... installing: libarchive-3.3.3-h786848e_5 ... installing: libxslt-1.1.33-h33a18ac_0 ... installing: mpc-1.1.0-h6ef4df4_1 ... installing: sqlite-3.27.2-ha441bb4_0 ... installing: unixodbc-2.3.7-h1de35cc_0 ... installing: dbus-1.13.6-h90a0687_0 ... installing: libcurl-7.64.0-h051b688_2 ... installing: qt-5.9.7-h468cd18_1 ... installing: alabaster-0.7.12-py37_0 ... installing: appnope-0.1.0-py37_0 ... installing: appscript-1.1.0-py37h1de35cc_0 ... installing: asn1crypto-0.24.0-py37_0 ... installing: atomicwrites-1.3.0-py37_1 ... installing: attrs-19.1.0-py37_1 ... installing: backcall-0.1.0-py37_0 ... installing: backports-1.0-py37_1 ... installing: bitarray-0.8.3-py37h1de35cc_0 ... installing: boto-2.49.0-py37_0 ... installing: certifi-2019.3.9-py37_0 ... installing: chardet-3.0.4-py37_1 ... installing: click-7.0-py37_0 ... installing: cloudpickle-0.8.0-py37_0 ... installing: colorama-0.4.1-py37_0 ... installing: contextlib2-0.5.5-py37_0 ... installing: curl-7.64.0-ha441bb4_2 ... installing: dask-core-1.1.4-py37_1 ... installing: decorator-4.4.0-py37_1 ... installing: defusedxml-0.5.0-py37_1 ... installing: docutils-0.14-py37_0 ... installing: entrypoints-0.3-py37_0 ... installing: et_xmlfile-1.0.1-py37_0 ... installing: fastcache-1.0.2-py37h1de35cc_2 ... installing: filelock-3.0.10-py37_0 ... installing: future-0.17.1-py37_0 ... installing: glob2-0.6-py37_1 ... installing: gmpy2-2.0.8-py37h6ef4df4_2 ... installing: greenlet-0.4.15-py37h1de35cc_0 ... installing: heapdict-1.0.0-py37_2 ... installing: idna-2.8-py37_0 ... installing: imagesize-1.1.0-py37_0 ... installing: ipython_genutils-0.2.0-py37_0 ... installing: itsdangerous-1.1.0-py37_0 ... installing: jdcal-1.4-py37_0 ... installing: kiwisolver-1.0.1-py37h0a44026_0 ... installing: lazy-object-proxy-1.3.1-py37h1de35cc_2 ... installing: llvmlite-0.28.0-py37h8c7ce04_0 ... installing: locket-0.2.0-py37_1 ... installing: lxml-4.3.2-py37hef8c89e_0 ... installing: markupsafe-1.1.1-py37h1de35cc_0 ... installing: mccabe-0.6.1-py37_1 ... installing: mistune-0.8.4-py37h1de35cc_0 ... installing: mkl-service-1.1.2-py37hfbe908c_5 ... installing: more-itertools-6.0.0-py37_0 ... installing: mpmath-1.1.0-py37_0 ... installing: msgpack-python-0.6.1-py37h04f5b5a_1 ... installing: numpy-base-1.16.2-py37h6575580_0 ... installing: olefile-0.46-py37_0 ... installing: pandocfilters-1.4.2-py37_1 ... installing: parso-0.3.4-py37_0 ... installing: pep8-1.7.1-py37_0 ... installing: pickleshare-0.7.5-py37_0 ... installing: pkginfo-1.5.0.1-py37_0 ... installing: pluggy-0.9.0-py37_0 ... installing: ply-3.11-py37_0 ... installing: prometheus_client-0.6.0-py37_0 ... installing: psutil-5.6.1-py37h1de35cc_0 ... installing: ptyprocess-0.6.0-py37_0 ... installing: py-1.8.0-py37_0 ... installing: py-lief-0.9.0-py37h1413db1_2 ... installing: pycodestyle-2.5.0-py37_0 ... installing: pycosat-0.6.3-py37h1de35cc_0 ... installing: pycparser-2.19-py37_0 ... installing: pycrypto-2.6.1-py37h1de35cc_9 ... installing: pycurl-7.43.0.2-py37ha12b0ac_0 ... installing: pyflakes-2.1.1-py37_0 ... installing: pyodbc-4.0.26-py37h0a44026_0 ... installing: pyparsing-2.3.1-py37_0 ... installing: pysocks-1.6.8-py37_0 ... installing: python-libarchive-c-2.8-py37_6 ... installing: python.app-2-py37_9 ... installing: pytz-2018.9-py37_0 ... installing: pyyaml-5.1-py37h1de35cc_0 ... installing: pyzmq-18.0.0-py37h0a44026_0 ... installing: qtpy-1.7.0-py37_1 ... installing: rope-0.12.0-py37_0 ... installing: ruamel_yaml-0.15.46-py37h1de35cc_0 ... installing: send2trash-1.5.0-py37_0 ... installing: simplegeneric-0.8.1-py37_2 ... installing: sip-4.19.8-py37h0a44026_0 ... installing: six-1.12.0-py37_0 ... installing: snowballstemmer-1.2.1-py37_0 ... installing: sortedcontainers-2.1.0-py37_0 ... installing: soupsieve-1.8-py37_0 ... installing: sphinxcontrib-1.0-py37_1 ... installing: sqlalchemy-1.3.1-py37h1de35cc_0 ... installing: tblib-1.3.2-py37_0 ... installing: testpath-0.4.2-py37_0 ... installing: toolz-0.9.0-py37_0 ... installing: tornado-6.0.2-py37h1de35cc_0 ... installing: tqdm-4.31.1-py37_1 ... installing: unicodecsv-0.14.1-py37_0 ... installing: wcwidth-0.1.7-py37_0 ... installing: webencodings-0.5.1-py37_1 ... installing: werkzeug-0.14.1-py37_0 ... installing: wrapt-1.11.1-py37h1de35cc_0 ... installing: wurlitzer-1.0.2-py37_0 ... installing: xlrd-1.2.0-py37_0 ... installing: xlsxwriter-1.1.5-py37_0 ... installing: xlwt-1.3.0-py37_0 ... installing: zipp-0.3.3-py37_1 ... installing: babel-2.6.0-py37_0 ... installing: backports.os-0.1.1-py37_0 ... installing: backports.shutil_get_terminal_size-1.0.0-py37_2 ... installing: beautifulsoup4-4.7.1-py37_1 ... installing: cffi-1.12.2-py37hb5b8e2f_1 ... installing: cycler-0.10.0-py37_0 ... installing: cytoolz-0.9.0.1-py37h1de35cc_1 ... installing: html5lib-1.0.1-py37_0 ... installing: importlib_metadata-0.8-py37_0 ... installing: jedi-0.13.3-py37_0 ... installing: keyring-18.0.0-py37_0 ... installing: mkl_random-1.0.2-py37h27c97d8_0 ... installing: multipledispatch-0.6.0-py37_0 ... installing: nltk-3.4-py37_1 ... installing: openpyxl-2.6.1-py37_1 ... installing: packaging-19.0-py37_0 ... installing: partd-0.3.10-py37_1 ... installing: pathlib2-2.3.3-py37_0 ... installing: pexpect-4.6.0-py37_0 ... installing: pillow-5.4.1-py37hb68e598_0 ... installing: pyqt-5.9.2-py37h655552a_2 ... installing: pyrsistent-0.14.11-py37h1de35cc_0 ... installing: python-dateutil-2.8.0-py37_0 ... installing: qtawesome-0.5.7-py37_1 ... installing: setuptools-40.8.0-py37_0 ... installing: singledispatch-3.4.0.3-py37_0 ... installing: sortedcollections-1.1.2-py37_0 ... installing: sphinxcontrib-websupport-1.1.0-py37_1 ... installing: sympy-1.3-py37_0 ... installing: terminado-0.8.1-py37_1 ... installing: traitlets-4.3.2-py37_0 ... installing: xlwings-0.15.4-py37_0 ... installing: zict-0.1.4-py37_0 ... installing: astroid-2.2.5-py37_0 ... installing: bleach-3.1.0-py37_0 ... installing: clyent-1.2.2-py37_1 ... installing: cryptography-2.6.1-py37ha12b0ac_0 ... installing: cython-0.29.6-py37h0a44026_0 ... installing: distributed-1.26.0-py37_1 ... installing: get_terminal_size-1.0.0-h7520d66_0 ... installing: gevent-1.4.0-py37h1de35cc_0 ... installing: isort-4.3.16-py37_0 ... installing: jinja2-2.10-py37_0 ... installing: jsonschema-3.0.1-py37_0 ... installing: jupyter_core-4.4.0-py37_0 ... installing: navigator-updater-0.2.1-py37_0 ... installing: networkx-2.2-py37_1 ... installing: nose-1.3.7-py37_2 ... installing: path.py-11.5.0-py37_0 ... installing: pygments-2.3.1-py37_0 ... installing: pytest-4.3.1-py37_0 ... installing: wheel-0.33.1-py37_0 ... installing: conda-verify-3.1.1-py37_0 ... installing: flask-1.0.2-py37_1 ... installing: jupyter_client-5.2.4-py37_0 ... installing: nbformat-4.4.0-py37_0 ... installing: pip-19.0.3-py37_0 ... installing: prompt_toolkit-2.0.9-py37_0 ... installing: pylint-2.3.1-py37_0 ... installing: pyopenssl-19.0.0-py37_0 ... installing: pytest-openfiles-0.3.2-py37_0 ... installing: pytest-remotedata-0.3.1-py37_0 ... installing: ipython-7.4.0-py37h39e3cac_0 ... installing: nbconvert-5.4.1-py37_3 ... installing: urllib3-1.24.1-py37_0 ... installing: ipykernel-5.1.0-py37h39e3cac_0 ... installing: requests-2.21.0-py37_0 ... installing: anaconda-client-1.7.2-py37_0 ... installing: conda-4.6.11-py37_0 ... installing: jupyter_console-6.0.0-py37_0 ... installing: notebook-5.7.8-py37_0 ... installing: qtconsole-4.4.3-py37_0 ... installing: sphinx-1.8.5-py37_0 ... installing: spyder-kernels-0.4.2-py37_0 ... installing: anaconda-navigator-1.9.7-py37_0 ... installing: anaconda-project-0.8.2-py37_0 ... installing: conda-build-3.17.8-py37_0 ... installing: jupyterlab_server-0.2.0-py37_0 ... installing: numpydoc-0.8.0-py37_0 ... installing: widgetsnbextension-3.4.2-py37_0 ... installing: ipywidgets-7.4.2-py37_0 ... installing: jupyterlab-0.35.4-py37hf63ae98_0 ... installing: spyder-3.3.3-py37_0 ... installing: _ipyw_jlab_nb_ext_conf-0.1.0-py37_0 ... installing: jupyter-1.0.0-py37_7 ... installing: bokeh-1.0.4-py37_0 ... installing: bottleneck-1.2.1-py37h1d22016_1 ... installing: h5py-2.9.0-py37h3134771_0 ... installing: imageio-2.5.0-py37_0 ... installing: matplotlib-3.0.3-py37h54f8f79_0 ... installing: mkl_fft-1.0.10-py37h5e564d8_0 ... installing: numpy-1.16.2-py37hacdab7b_0 ... installing: numba-0.43.1-py37h6440ff4_0 ... installing: numexpr-2.6.9-py37h7413580_0 ... installing: pandas-0.24.2-py37h0a44026_0 ... installing: pytest-arraydiff-0.3-py37h39e3cac_0 ... installing: pytest-doctestplus-0.3.0-py37_0 ... installing: pywavelets-1.0.2-py37h1d22016_0 ... installing: scipy-1.2.1-py37h1410ff5_0 ... installing: bkcharts-0.2-py37_0 ... installing: dask-1.1.4-py37_1 ... installing: patsy-0.5.1-py37_0 ... installing: pytables-3.5.1-py37h5bccee9_0 ... installing: pytest-astropy-0.5.0-py37_0 ... installing: scikit-image-0.14.2-py37h0a44026_0 ... installing: scikit-learn-0.20.3-py37h27c97d8_0 ... installing: astropy-3.1.2-py37h1de35cc_0 ... installing: statsmodels-0.9.0-py37h1d22016_0 ... installing: seaborn-0.9.0-py37_0 ... installing: anaconda-2019.03-py37_0 ... installation finished. ==> Changing ownership of paths required by anaconda; your password may be necessary 🍺 anaconda was successfully installed!
設定環境路徑
加入 anaconda 的安裝路徑,
1 export PATH="/usr/local/anaconda3/bin:$PATH "
重啓 terminal 或是執行 source ~/.zshrc
重載入環境變數。
開始使用 jupyter notebook 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 $ jupyter notebook [I 17:11:37.762 NotebookApp] Writing notebook server cookie secret to /Users/jerryhuang/Library/Jupyter/runtime/notebook_cookie_secret [I 17:11:38.780 NotebookApp] JupyterLab extension loaded from /usr/local/anaconda3/lib/python3.7/site-packages/jupyterlab [I 17:11:38.780 NotebookApp] JupyterLab application directory is /usr/local/anaconda3/share/jupyter/lab [I 17:11:38.781 NotebookApp] Serving notebooks from local directory: /Users/jerryhuang/workspace/redfalcon/brazil/carnival.2019 [I 17:11:38.781 NotebookApp] The Jupyter Notebook is running at: [I 17:11:38.781 NotebookApp] http://localhost:8888/?token=7644583630c119f4ce453430fa6993b6cc8c9fe6258d2026 [I 17:11:38.782 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). [C 17:11:38.793 NotebookApp] To access the notebook, open this file in a browser: file:///Users/jerryhuang/Library/Jupyter/runtime/nbserver-50420-open.html Or copy and paste one of these URLs: http://localhost:8888/?token=7644583630c119f4ce453430fa6993b6cc8c9fe6258d2026 ^C[I 17:12:02.475 NotebookApp] interrupted Serving notebooks from local directory: /Users/jerryhuang/workspace/redfalcon/brazil/carnival.2019 0 active kernels The Jupyter Notebook is running at: http://localhost:8888/?token=7644583630c119f4ce453430fa6993b6cc8c9fe6258d2026
參考資料 References
[Install anaconda on macOS with homebrew] 3