I have some code doing a very basic usage of it. It only contains two lines related to requests-cache, the import and requests_cache.install_cache('localcache.db') The symptom is the following: AttributeError: module 'requests_cache' has no attribute 'install_cache' At first i suspected the update from dev-python/requests-cache-0.9.1 to dev-python/requests-cache-0.9.3, but checking the source code, the install_cache is still there, and mostly unchanged. Then i did some tests (from bpython): >>> import requests >>> import requests_cache No module named 'bson' >>> import requests_cache >>> This error 'bson' is the source i guess. Even if it is silent, it seems this error prevent the 'patcher' module from requests_cache to load. Further testing: >>> from requests_cache.patcher import * Traceback (most recent call last): File "<input>", line 1, in <module> from requests_cache.patcher import * File "/usr/lib/python3.9/site-packages/requests_cache/patcher.py", line 16, in <module> from .backends import BackendSpecifier, BaseCache File "/usr/lib/python3.9/site-packages/requests_cache/backends/__init__.py", line 7, in <module> from .base import BaseCache, BaseStorage, DictStorage File "/usr/lib/python3.9/site-packages/requests_cache/backends/base.py", line 18, in <module> from ..serializers import init_serializer File "/usr/lib/python3.9/site-packages/requests_cache/serializers/__init__.py", line 6, in <module> from .preconf import ( File "/usr/lib/python3.9/site-packages/requests_cache/serializers/preconf.py", line 18, in <module> from cattr.preconf import bson as bson_preconf File "/usr/lib/python3.9/site-packages/cattr/preconf/bson.py", line 6, in <module> from bson import DEFAULT_CODEC_OPTIONS, CodecOptions, ObjectId, decode, encode ModuleNotFoundError: No module named 'bson' >>> After this, i'm really not sure. It might have a relation to this update (cattrs is a dependancy for requests-cache) Wed Apr 13 14:18:16 2022 >>> dev-python/cattrs-1.10.0-r1 Thu May 12 11:58:37 2022 >>> dev-python/cattrs-22.1.0 The ebuild for dev-python/cattrs-22.1.0 mentions a dev-python/bson, but it is commented out. My system doesn't have such a package (checked with eix and ls in portage 'dev-python/'). Reproducible: Always
I think it was supposed to be fixed in requests-cache 0.9.4. If you could confirm that, I'd remove 0.9.3.
0.9.4 seems to fix it indeed. Thanks !