ImportError: cannot import name 'Optional' from 'torch.jit.annotations'
I have installed cpuonly pytorch and torchvision in anaconda. But when i try to import torchvision i get the following error.
ImportError: cannot import name 'Optional' from 'torch.jit.annotations'(C:\Users\MSI\Anaconda3\lib\site-packages\torch\jit\annotations.py)
How can i fix this?

Not sure if you are installing the correct versions of the libraries. This combination seems to work:

conda create --name test5 python=3.6
conda install -c pytorch pytorch torchvision cpuonly
python
&gt;&gt;&gt; import torchvision

