deep-learning-with-pytorch / dlwpt-code

Code for the book Deep Learning with PyTorch by Eli Stevens, Luca Antiga, and Thomas Viehmann.
https://www.manning.com/books/deep-learning-with-pytorch
4.74k stars 2.01k forks source link

ImportError: cannot import name 'BytesType' from 'diskcache.core' #19

Closed sandip1604 closed 4 years ago

sandip1604 commented 4 years ago

Hello Everyone

I am trying to learn along with the book by building cancer detection along with the book. However I get the following error. Traceback (most recent call last):

File "/home/sandip/code/dsets.py", line 16, in from util.disk import getCache

File "/home/sandip/code/util/disk.py", line 4, in from diskcache.core import BytesType, MODE_BINARY, BytesIO

ImportError: cannot import name 'BytesType' from 'diskcache.core' (/home/sandip/anaconda3/envs/breast_cancer/lib/python3.7/site-packages/diskcache/core.py)

image

Please guide me to fix the issue.

Thanks in advance

emilearthur commented 4 years ago

same issue here!!

emilearthur commented 4 years ago

@sandip1604 install diskcache version 4.1.0., Current version of diskcache does not have BytesType included. Use pip install "diskcache==4.1.0" instead of pip install diskcache, which installs the current version