pycalphadのインストール

pip(推奨)

PyPI から pycalphad をインストールするには pipを使います。

pip install -U pip setuptools
pip install -U pycalphad

このとき仮想環境を作成してインストールすることがおすすめです。

Windowsで``pycalphad-env`` という名前の仮想環境を作成してpycalphadをインストールするには以下のようにします。

python -m venv pycalphad-env
pycalphad-env\Scripts\activate
pip install -U pycalphad jupyterlab

Mac/Linuxの場合には以下のようにします。

python -m venv pycalphad-env
source pycalphad-env/bin/activate
pip install -U pip setuptools
pip install -U pycalphad

次回以降pycalphad を使用する際には、この仮想環境を毎回 activate する必要があります(2行目だけ実行する)。

Jupyter notebook を使ってインストールをする場合

pipなどのコマンドをJupyter notebookを使って使用するには``!``を行頭に入力します。

!python -m venv pycalphad-env
!source pycalphad-env/bin/activate
!pip install -U pip setuptools
!pip install -U pycalphad

この場合でも次回以降pycalphad を使用する際には、この仮想環境を毎回 activate する必要があります(2行目だけ実行する)。

conda

Anaconda は Anaconda, Inc. によって作られた科学計算用 python パッケージのプラットフォームです。

conda パッケージマネジャーが付属しており、これを用いてパッケージのインストールを行います。

Anaconda をまだインストールしていない場合には、 Miniconda ディストリビューションの利用することもできます。

condaを使用して conda-forge からpycalphadをインストールするには以下のようにします。

conda install -c conda-forge pycalphad

Development version(開発バージョン)

Installing

The source code for the latest development version of pycalphad is available on GitHub. You will need a working version of git to download the source code. Installing development versions of pycalphad also requires a working C++ compiler.

To install an editable version the latest development branch of pycalphad, run:

git clone https://github.com/pycalphad/pycalphad.git
cd pycalphad
pip install -U pip setuptools
pip install -U -r requirements-dev.txt
pip install -U --no-build-isolation --editable .

Then run the automated tests to ensure everything installed correctly:

pytest pycalphad

Upgrading(アップグレード)

Changes to Python files (.py extension) in an editable install will be reflected as soon a file is saved. Changes to Cython files (.pyx and .pxd extensions) must be recompiled before they take effect. The Cython files can be recompiled by running (from the root directory [1] of the project):

python setup.py build_ext --inplace

By default, the development version installed will track the latest changes in the develop branch of pycalphad on GitHub.

To update the code in the current branch to the latest changes on GitHub, the changes are pulled from GitHub by running git pull.

To switch to a different branch, e.g. master (which tracks the latest released version) or another feature branch, run git checkout <branch>, where <branch> is the name of the branch to checkout, such as master (without the brackets < and >).