Yes, I know anaconda is recommended. But if you’ve already been using python+pip for a while, then anaconda may interfere with your already installed software (actually, it’s surprisingly hard to find information on whether anaconda and pip can coexist…)
On Ubuntu 18.04 LTS, a simple pip install fastai
doesn’t quite work, because pip will fetch the newest version of numpy, which conflicts with the version in the Ubuntu repositories (1.16 vs 1.13). So instead you want to put fastai in its own virtual environment.
This worked for me (having installed CUDA on a previous occasion):
pip install virtualenv
python -m virtualenv fastai_env
source fastai_env/bin/activate
# your prompt should change to show (fastai_env) at the start
pip install fastai # wait a long time while stuff gets downloaded!
pip install ipykernel
python -m ipykernel install --user --name fastai_env --display-name "Python3 (fastai_env)"
deactivate # prompt changes back to normal
Then within Jupyter, when you open a notebook for the first time, you’ll need to use the “kernel” menu to change over to the fastai environment.
More information about working with virtual environments: