In the latest release of requests-cache (0.6.0), hashlib is no longer imported in requests_cache/backends/base.py leading to this import error:
File "..../chembl_webresource_client/cache.py", line 3, in <module>
from requests_cache.backends.base import BaseCache, hashlib, _to_bytes
ImportError: cannot import name 'hashlib' from 'requests_cache.backends.base' (.../requests_cache/backends/base.py)
The relevant line is this:
from requests_cache.backends.base import BaseCache, hashlib, _to_bytes
This should be fixable by importing hashlib directly
import hashlib
_to_bytes is also no longer available in requests-cache. The previous implementation was:
def _to_bytes(s, encoding='utf-8'):
return s if isinstance(s, bytes) else bytes(s, encoding)
In the latest release of requests-cache (0.6.0),
hashlib
is no longer imported inrequests_cache/backends/base.py
leading to this import error:The relevant line is this:
This should be fixable by importing
hashlib
directly_to_bytes
is also no longer available inrequests-cache
. The previous implementation was: