【问题标题】:Jupyter: jupyter-notebook can not import module statsmodelsJupyter:jupyter-notebook 无法导入模块 statsmodels
【发布时间】:2017-05-08 20:15:23
【问题描述】:
我已经在 MacOS 10.9 Mavericks 中安装了 jupyter notebook,使用命令
pip3 install jupyter
我可以导入一些库,如 numpy、pandas 并正常运行 Jupiter notebook,但是,如果我导入模块 statsmodels,它会显示 No Module named "statsmodels"。
我们如何在 jupyter-notebook 中运行已安装的库 statsmodels?
【问题讨论】:
标签:
jupyter-notebook
jupyter
【解决方案1】:
我遇到了同样的问题。
那是因为该模块是为 python2 安装的,而不是为您正在使用的 python3 安装的。
找到与 jupyter 相关的 python3 bin。
$jupyter --paths
我的在 /usr/local/Cellar/python3/3.5.2_3/bin
运行:
$python3 -mpip install statsmodels
干杯