在 Jupyter Notebook 上安装程序时出现问题

问题描述

我正在尝试安装一个我需要用于我的研究的程序,但我遇到了问题。该程序名为“hmf”,我可以使用 pip install hmf 成功安装它。但是,当我尝试导入模块时,出现问题:This image shows the error message I get,即

ImportError: cannot import name 'CAMB' from 'hmf.density_field.transfer_models' (/Users/cammienorton/opt/anaconda3/lib/python3.8/site-packages/hmf/density_field/transfer_models.py)

根据 https://hmf.readthedocs.io/en/latest/installation.html 上的在线建议,我试过跑步

conda install -c conda-forge numpy scipy astropy camb

而且我没有收到任何错误消息。有没有人知道发生了什么?

更新:我尝试了 pip install CAMB 并收到了 following error message,它表示构建轮子时出错。

解决方法

CAMB 包在您的 python 安装中不可用

pip install CAMB

这应该可以解决