网页 综合 更新时间 2026-11-14 10:01:55

Installing with Conda — Cantera 3.2.0 documentation

自动蜘蛛 cantera.org 正文约 4869 字
Conda is a package manager that can be used to install Python packages and other software. Cantera packages are available via the conda-forge channel, for use with Conda distributions that use that channel. We highly recommend using the Miniforge distribution, which configures conda-forge as the default channel (in which case you can omit the argument --channel conda-forge from any of the commands below).
For more details on how to use Conda, see the Conda documentation.
For instructions on upgrading an existing Conda-based installation of Cantera, see Upgrading from an earlier Cantera version.
Cantera’s Python interface can be installed from the popular conda-forge channel. Packages are available for the following platforms:
Windows (64-bit Intel)
Linux (64-bit Intel, 64-bit ARM, and 64-bit PPCLE)
macOS (64-bit Intel and 64-bit ARM (Apple Silicon))
The following instructions will create a Conda environment where you can use Cantera from Python. For this example, the environment is named ct-env. From the command line (or the Conda Prompt on Windows), run:
This will create an environment named ct-env with Cantera, IPython, Matplotlib, and all their dependencies installed.
To use the scripts and modules installed in the ct-env environment, including Jupyter, you must activate it it by running:
This option is similar to Option 1 but includes a few other packages that you may find helpful as you’re working with Cantera. Copy and paste the contents of the file shown below into a file called environment.yaml. Then, save the the file somewhere and remember that location.
From the command line (or the Conda Prompt on Windows), change directory into the folder where you saved environment.yaml:
This will create an environment called ct-env. Once you’ve done that, you need to activate the environment before using any scripts or modules that you just installed:
To install a recent development snapshot (that is, an alpha or beta version) of Cantera, use the conda-forge/label/cantera_dev channel. Assuming you have an environment named ct-dev, you can type:
If you later want to revert back to the stable version in that environment, first remove and then reinstall Cantera:
Alternatively, you can remove the ct-dev environment and follow Options 1 or 2 above to create a new environment.
If you already have Cantera installed in a Conda environment (named, for example, ct-dev), you can upgrade it to the latest version available by running the commands:
This upgrade option will only work if the previous version of Cantera was also installed from the conda-forge channel. If you used the packages from the cantera channel that were also provided for Cantera 3.0 and earlier, this upgrade path will not work and you should install Cantera in a new Conda environment.
The Cantera development interface provides header files and libraries needed to compile your own C++, C, Fortran, and MATLAB applications that link to Cantera. It also provides several sample programs and build scripts that you can adapt for your own applications.
From the command line (or the Conda Prompt on Windows), create a new Conda environment named ct-dev using:
C++ header and libraries are installed within the ct-dev environment folder, which itself depends on the type of conda installation, and is abbreviated as path/to/conda/envs below. Within the ct-dev folder, locations follow conda recommendations for a given operating system.
Installation folders are:
In addition to libcantera-devel, installation of additional packages is recommended:
C++ programs can be compiled according to instructions outlined in the C++ Guide. Sample folders for C, C++ and Fortran include pre-configured instruction files to facilitate compilation using the build tools SCons and CMake, for example:
In addition, individual C++ Cantera sample programs can also be compiled using the pkg-config build system:
In all cases, the build process yields the executable demo, which is run as:
Installation folders are:
C++ programs can be compiled according to instructions outlined in the C++ Guide. Sample folders for C and C++ programs include preconfigured instruction files to facilitate compilation using the build tools SCons and CMake, for example:
Fortran 90 support is not provided for Windows.
If you already have the Cantera development interface installed in a Conda environment (named, for example, ct-dev), you can upgrade it to the latest version available by running the commands:
The legacy Matlab Cantera interface was discontinued and removed in Cantera 3.1. Users requiring support of legacy Matlab Cantera code should continue using Cantera 3.0 packages, or migrate their code base to the experimental Matlab toolbox that is currently under development.
© Copyright 2001-2025, Cantera Developers.
Created using Sphinx 7.3.7.
Built with the PyData Sphinx Theme 0.15.4.
访问原文 返回搜索 https://cantera.org/stable/install/conda.html
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。