Error: No module named 'fastai'

When trying out the jupyter notebook, I tried to run the first two cells. Almost immediately, I got the error that there is “No module named ‘fastai’”. I tried following the steps for windows installation and am still having issues.

1 Like

Either you can create a symbolic link
(ln -s path/where/to/create/link path/of/folder/to/create/link)
to the fastai/fastai folder OR you can run your notebook in the folder where the fastai module exists


Another method would be to add the fastai folder to the PYTHONPATH environment variable

And another method is to add path to fastai into your notebook:
import sys

1 Like

How do you do this? I stumbled on this post, but I’m a total noob how do I do this? I launch conda prompt, type in “activate fastai” and then launch my jupyter notebook and still no go? I tried switching the kern to FastAI Custom and still no dice, how would I impleement your method

you are using it on your machine or on the cloud ?

Yes, using my own machine

then just copy the fastai/fastai modules folder to the directory where you are working

Sorry, but how do I do this? Are you referring to the files from github?

yes , just copy them to your working directory

Replace the linux symlink with a Windows one (note that this requires an admin command prompt if you don’t have a fully updated version of Windows 10):
cd courses\dl1
del fastai
mklink /d fastai …\fastai
cd …

After that if still issue exists then do “pip install fastai” on ur conda environment

I am having troubles setting things up. Using and found that there already is a foldercourses/fast-ai/course-v3 which seems wrong, looks like something to be released in 2019?
So instad I did git clone
But when I try to run the second cell in the first notebook I also get

<ipython-input-6-713ddf51e021> in <module>()
----> 1 from fastai.imports import *

To check path:
[’’, ‘/home/nbuser/courses/ml-created-by-me/fastai/courses/ml1’, ‘/home/nbuser/.anaconda3/lib/’, ‘/home/nbuser/.anaconda3/lib/python3.7’, ‘/home/nbuser/.anaconda3/lib/python3.7/lib-dynload’, ‘/home/nbuser/.anaconda3/lib/python3.7/site-packages’, ‘/home/nbuser/.anaconda3/lib/python3.7/site-packages/IPython/extensions’, ‘/home/nbuser/.ipython’]

Since pwd is in sys.path shouldn’t it work?
Or is the problem something to do with that in crestle jupyter is started via the webpage (a button)?
Thank you

I am having the same problems as in this article. Why is it so hard to setup?

1 Like