ImportError: cannot import name 'IterableDataset' from 'torch.utils.data'

Ok, if you edit /lib/systemd/system/jupyter.service and change ExecStart to be as follows

ExecStart=/bin/bash --login -c 'conda activate fastai_dev;/opt/anaconda3/bin/jupyter lab --config=/home/jupyter/.jupyter/jupyter_notebook_config.py'

that will set the environment to the fastai_dev one that you created when you cloned the fastai_dev repo and installed the fastai2 package.

You need to run sudo systemctl daemon-reload and then restart the service with sudo systemctl restart jupyter to get the new file to be active.

Unfortunately, that didn’t solve my problem. If I do conda list torch in the notebook it says that pytorch version 1.3 is installed.

Here is sys.path:

['/home/jupyter/tutorials/fastai',
 '/opt/anaconda3/lib/python37.zip',
 '/opt/anaconda3/lib/python3.7',
 '/opt/anaconda3/lib/python3.7/lib-dynload',
 '',
 '/opt/anaconda3/lib/python3.7/site-packages',
 '/home/jupyter/tutorials/fastai/fastai_dev',
 '/opt/anaconda3/lib/python3.7/site-packages/IPython/extensions',
 '/home/jupyter/.ipython']