安装simnibs有两种途径:直接安装;conda安装。本帖介绍利用conda安装simnibs。
1.安装Miniconda(由于我的电脑已经安装过conda24.5.0,所以直接省略该步骤)
2.下载simnibs在linux系统下的环境文件(选择environment_linux.yml):linux下所需环境文件
3.在终端中运行以下命令来创建并激活SimNIBS的Conda环境:
conda env create -f ~/Downloads/environment_linux.yml
conda activate simnibs_env
(在我安装的过程中,运行第一行的时候报错:HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out. failed,这是由于网络原因超时了。可以选择切换镜像源进行解决。先将创建的环境移除,再指定国内镜像源,再重新创建。具体为:
conda clean --all # 清理缓存
conda env remove -n simnibs_env # 移除之前失败的环境
可以通过以下命令全局配置 Conda 使用国内的镜像源(以清华大学镜像源为例)
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
然后,再运行创建环境的命令
conda env create -f ~/Downloads/environment_linux.yml
)
4.安装simnibs
https://github.com/simnibs/simnibs/releases/tag/v4.1.0
打开上述链接,下载
在终端输入
conda activate simnibs_env#进入simnibs虚拟环境
pip install /path/to/simnibs-4.1.0-cp39-cp39-linux_x86_64.whl##/path/to替换为文件的实际下载目录。