之所以要手动安装conda而不是anaconda,是因为anaconda过于冗长,对于系统的空间占用过大。

安装Miniconda

安装包来自https://docs.conda.io/en/latest/miniconda.html
在命令行中使用bash ./Miniconda3-latest-MacOSX-x86_64.sh
然后一路回车,记下安装的位置,默认·/Users/yao/miniconda3/
~/.zshrc里新增一行export PATH=/Users/yao/miniconda3/bin:$PATH,并source设置一下环境变量。
wchih conda即可查看是否安装成功。

安装jupyter/lab

conda install jupyter
conda install jupyterlab
# 查看安装的版本
jupyter --version
jupyter core     : 4.6.1
jupyter-notebook : 6.0.2
qtconsole        : 4.6.0
ipython          : 7.10.2
ipykernel        : 5.1.3
jupyter client   : 5.3.4
jupyter lab      : 1.2.4
nbconvert        : 5.6.1
ipywidgets       : 7.5.1
nbformat         : 4.4.0
traitlets        : 4.3.3

# 查看python相关版本,都来自miniconda3
 ~  which python
/Users/yao/miniconda3/bin/python
 ~  which python3
/Users/yao/miniconda3/bin/python3
 ~  which ipython
/Users/yao/miniconda3/bin/ipython
 ~  which ipython3
/Users/yao/miniconda3/bin/ipython3
 ~  which jupyter
/Users/yao/miniconda3/bin/jupyter

启动jupyterlab

~  jupyter lab
[I 18:00:29.842 LabApp] JupyterLab extension loaded from /Users/yao/miniconda3/lib/python3.7/site-packages/jupyterlab
[I 18:00:29.842 LabApp] JupyterLab application directory is /Users/yao/miniconda3/share/jupyter/lab
[I 18:00:30.449 LabApp] Serving notebooks from local directory: /Users/yao
[I 18:00:30.450 LabApp] The Jupyter Notebook is running at:
[I 18:00:30.450 LabApp] http://localhost:8888/?token=3e75a249d7106b4b8a9e676a9be65ff4605741bf10da26b1
[I 18:00:30.450 LabApp]  or http://127.0.0.1:8888/?token=3e75a249d7106b4b8a9e676a9be65ff4605741bf10da26b1
[I 18:00:30.450 LabApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 18:00:30.457 LabApp]

    To access the notebook, open this file in a browser:
        file:///Users/yao/Library/Jupyter/runtime/nbserver-3294-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/?token=3e75a249d7106b4b8a9e676a9be65ff4605741bf10da26b1
     or http://127.0.0.1:8888/?token=3e75a249d7106b4b8a9e676a9be65ff4605741bf10da26b1
[I 18:00:32.588 LabApp] 301 GET /lab/workspaces/auto-c/?clone (::1) 0.62ms
[I 18:00:34.413 LabApp] Build is up to date

Conda 常用包

conda install numpy
conda install matplotlib
conda install cartopy
conda install xarray #包含pandas
conda install netcdf4
conda install -c conda-forge cmocean

Jupyter Notebook 常用插件

conda install -c conda-forge jupyter_contrib_nbextensions
conda install -c conda-forge jupyter_nbextensions_configurator
  • Codefolding
  • Collapsible Headings
  • ExecuteTime
  • Nbextensions
  • Nbextensions dashboard tab
  • Nbextensions edit menu item
  • nbextesions_configurator
  • Notify
  • Table of Contents(2)
  • Tree Filter
  • Cariable Inspector

一键更新全部库

conda update --all
Last modification:January 15th, 2020 at 07:43 pm
If you think my article is useful to you, please feel free to appreciate