无法在Jupyter Notebook上运行fastai库

时间:2018-05-29 10:23:37

标签: python machine-learning anaconda jupyter-notebook fast-ai

我希望这个问题不是多余的,但到目前为止我还无法在互联网上找到解决方案。我按照github指南(https://github.com/fastai/fastai)在我的Anaconda环境中安装了fastai库。我想用这个库来解决ML课程并用它来解决其他Kaggle比赛。

如下所示,我打开我的conda环境,选择fastai并打开Jupyter Notebook:

enter image description here

当试图在Jupyter中运行包时,我仍然得到一个没有名为'fastai'的模块的导入错误。关于我做错了什么的建议?

3 个答案:

答案 0 :(得分:1)

有同样的问题。看起来问题是“软链接”fastai在Windows上无效 我用来自存储库根目录的真实模块fastai替换了那些soflink来修复它。只需将其复制到课程\ dl1,courses \ dl2,courses \ dm1和tutorials文件夹即可。
Prerry脏。但是有效。让我知道如何修复它而不复制。

答案 1 :(得分:1)

在笔记本的开头!python -m pip install git+https://github.com/fastai/fastai.git

中添加一个单元格

编辑:

现在,fastai是1.0,并且在点子上,您可能只想!python -m pip install fastai

我更喜欢!python -m pip语法,而不是在混合anaconda和pip时仅调用pip,但这可能只是反映了我系统的python被弄乱了。

答案 2 :(得分:0)

我在jupyter实验室捣乱fastai_v1工作,但它工作在终端上。因此,问题是与在虚拟环境中没有当它被推出jupyter实验室被选择。

我使用下面的代码使其工作。与虚拟环境名称替换“myenv”。

source activate myevn

python -m ipykernel install --user --name myenv --display-name "Python (myenv)"

jupyter lab

此处有更多信息:Conda environments not showing up in Jupyter Notebook