在Debian12的Conda环境下安装MOOSE

发布时间 2023-12-24 18:41:47作者: Jankin-Wen

基于 MOOSE 的应用程序开发所需的依赖项的大量库首选方法是通过 Conda获取。按照以下说明使用 Conda 在计算机上创建环境。
1.安装Miniforge。
根据您的平台,请按照以下步骤安装 Miniforge。如果您在这些步骤中遇到问题,请访问我们的 Conda 故障排除指南。

Linux Users:
Linux用户:

点击查看代码
curl -L -O https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh
bash Miniforge3-Linux-x86_64.sh -b -p ~/miniforge

Macintosh Users with Intel processors:
使用 Intel 处理器的 Macintosh 用户:

点击查看代码
curl -L -O https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-x86_64.sh
bash Miniforge3-MacOSX-x86_64.sh -b -p ~/miniforge

Macintosh Users with Apple Silicon processors:
使用 Apple Silicon 处理器的 Macintosh 用户:

点击查看代码
curl -L -O https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh
bash Miniforge3-MacOSX-arm64.sh -b -p ~/miniforge

将 Miniforge 安装在主目录中后,导出 PATH 以便可以使用:

点击查看代码
export PATH=$HOME/miniforge/bin:$PATH
Now that we can execute conda, initialize it and then exit the terminal:

现在我们可以执行 conda ,初始化它,然后退出终端:

点击查看代码

conda init --all
exitCopy
Upon restarting your terminal, you should see your prompt prefixed with (base). This indicates you are in the base environment, and Conda is ready for operation: 重新启动终端后,您应该会看到以 (base) 为前缀的提示。这表示您处于基础环境中,并且 Conda 已准备好运行:
点击查看代码
$ (base) ~>
The next thing you should do after a fresh install, is perform an update to the base Conda environment: 全新安装后,您应该做的下一件事是对基本 Conda 环境执行更新:

注:**Miniforge vs Miniconda vs Anaconda **
他们的核心都是包含conda这一工具,来实现 python 环境(environment) 和 包(package) 管理的,(其实不仅仅可以用来管理python,很多语言R, Java, C都支持)。
Anaconda 和 Miniconda 是一个公司的产品,商用是付费的,个人暂时免费;而Miniforge是由社区主导,用GitHub托管,完全免费。Miniconda 和 Miniforge 是差不多的产物,代表着轻量化,而Anaconda是完整版,就略显臃肿。
Miniforge 使用conda-forge 作为默认 channel,而 Miniconda 使用anaconda.org 作为默认channel。

注:**conda channels (源) **
conda channels (源)是 packages 存储的位置,也即是你是从哪个来源下载这个包,对应到conda内部处理则是下载文件的链接。因为不同源会有相同名字的包,因此必须指定来源,同时安装conda的时候也会有一个默认的channel。目前主流的就是 conda-forge,齐全且更新快。如果有多个channel,他们会按顺序确定优先级,优先的源上找不到,就会到下一个优先级的源上去找。还可以设置channel的优先级是否strict,如果是strict的话,则只会在这一个源上查找。