ImportError: cannot import name 'FileUpload'

Hi,

During the lesson 2/3 material I encountered the ImportError below.
I updated Paperspace environment with:
pip install fastai2 fastcore --upgrade

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-2-87c13fad68c4> in <module>
      1 #hide
      2 from utils import *
----> 3 from fastai2.vision.widgets import *

/opt/conda/envs/fastai/lib/python3.6/site-packages/fastai2/vision/widgets.py in <module>
      8 from ..data.all import *
      9 from .core import *
---> 10 from ipywidgets import HBox,VBox,widgets,Button,Checkbox,Dropdown,Layout,Box,Output,Label,FileUpload
     11 
     12 # Cell

ImportError: cannot import name 'FileUpload'

Based on StackOverflow it seems to be due to circular dependent imports. Should I import FileUpload directly or should the order of imports be adjusted for example?
Any suggestions on how to solve this?

EDIT: I create a new Paperspace Notebook and duplicated the same lesson 2/3 Jupyter Notebook. Now it works :slight_smile: Probably had to do with the container (?)

Did you ever get an answer to this?

Can you try doing this before:

!pip install git+https://github.com/fastai/fastai2 
!pip install git+https://github.com/fastai/fastcore

and

from utils import *
from fastai2.vision.widgets import *
from fastai2.torch_basics import *
#Data Augmentation
from nbdev.showdoc import *

I am not having that error at the moment

Well, I don’t know the technical issue, but as mentioned I created a new container for Paperspace (the environment I use). This solved the problem. Probably had to do with software update.

1 Like