0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Minicondaの環境設定と大気海洋の解析で便利なライブラリ

Last updated at Posted at 2025-03-28

概要

minicondaのインストール方法と大気海洋の解析に必要なライブラリのインストール方法について説明する。

環境

  • OS: Ubuntu 22.04 LTS (Windows11 WSL2)

Minicondaのインストール

  1. (ipython, jupyter notebookを使用する場合) 必要なパッケージをインストール(これをしないとインストール後、sqlite3ライブラリの呼び出しでエラーとなった)。次の記事を参考にした。

    $ sudo apt update
    $ sudo apt install libsqlite3-dev libbz2-dev libncurses5-dev libgdbm-dev liblzma-dev libssl-dev tcl-dev tk-dev libreadline-dev
    

     

  2. 適当なディレクトリにMinicondaのインストール用シェルのダウンロード。2025/3/28時点の最新版は39.1.1-2

    $ mkdir hoge
    $ cd hoge 
    $ wget https://repo.anaconda.com/miniconda/Miniconda3-py39_25.1.1-2-Linux-x86_64.sh
    

     

  3. Minicondaのインストール。常にminicondaを使う場合は、conda initの実行をYesにする。

    $ bash Miniconda3-py39_25.1.1-2-Linux-x86_64.sh
    

     

  4. (常にminicondaを使う場合)~/.bashrcに以下があるか確認。なければ以下を追記。

    ~/.bashrc
    # >>> conda initialize >>>
    # !! Contents within this block are managed by 'conda init' !!
    __conda_setup="$('/home/usijimay/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
    if [ $? -eq 0 ]; then
        eval "$__conda_setup"
    else
        if [ -f "/home/usijimay/miniconda3/etc/profile.d/conda.sh" ]; then
            . "/home/usijimay/miniconda3/etc/profile.d/conda.sh"
        else
            export PATH="/home/usijimay/miniconda3/bin:$PATH"
        fi
    fi
    unset __conda_setup
    # <<< conda initialize <<<
    

condaの環境設定

  • condaでライブラリをインストールする際、defaultでconda-forgeを使用。

    $ conda config --add channels conda-forge
    

    (~/.condarcにcondaの設定が記載される。)

ライブラリのインストール

  • 解析に便利なライブラリ

    $ conda install numpy
    $ conda install scipy
    $ conda install pandas
    $ conda install matplotlib
    
  • 大気海洋の解析に便利なライブラリ

    $ conda install cartopy
    $ conda install eofs
    $ conda install cmocean
    $ conda install netcdf4
    $ conda install pygrib
    # conda install cdo
    # conda install pycdo
    
  • WRFの解析に便利なライブラリ

    $ conda install ncl
    $ conda install wrf-python
    

参考URL
https://qiita.com/Ihmon/items/11074e1a4c0e397d934f
https://qiita.com/kazetof/items/adeb331c99d408853f07
https://qiita.com/chatrate/items/bc37e3b7b303e834dd1e

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?