Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with request_cache #67

Open
Irazall opened this issue May 2, 2021 · 5 comments
Open

Problem with request_cache #67

Irazall opened this issue May 2, 2021 · 5 comments

Comments

@Irazall
Copy link

Irazall commented May 2, 2021

I get the following error message:

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/home/irazall/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/211.7142.13/plugins/python/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "/home/irazall/promotion/it/python-projects/envs/dynamic_pricing/lib/python3.8/site-packages/boardgamegeek/__init__.py", line 10, in <module>
    from .api import BGGClient, BGGChoose, BGGRestrictDomainTo, BGGRestrictPlaysTo, BGGRestrictSearchResultsTo, BGGRestrictCollectionTo
  File "/home/irazall/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/211.7142.13/plugins/python/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "/home/irazall/promotion/it/python-projects/envs/dynamic_pricing/lib/python3.8/site-packages/boardgamegeek/api.py", line 703, in <module>
    class BGGClient(BGGCommon):
  File "/home/irazall/promotion/it/python-projects/envs/dynamic_pricing/lib/python3.8/site-packages/boardgamegeek/api.py", line 727, in BGGClient
    def __init__(self, cache=CacheBackendMemory(ttl=3600), timeout=15, retries=3, retry_delay=5, disable_ssl=False, requests_per_minute=DEFAULT_REQUESTS_PER_MINUTE):
  File "/home/irazall/promotion/it/python-projects/envs/dynamic_pricing/lib/python3.8/site-packages/boardgamegeek/cache.py", line 23, in __init__
    self.cache = requests_cache.core.CachedSession(backend="memory", expire_after=ttl, allowable_codes=(200,))
AttributeError: module 'requests_cache' has no attribute 'core'

I assume that some dependencies are deprecated. Thanks anyway for implementing this tool!

@Irazall
Copy link
Author

Irazall commented May 2, 2021

Irazall added a commit to Irazall/boardgamegeek that referenced this issue May 2, 2021
Adapted cod to new request_cache repo
@giannimastroscianni
Copy link

Exactly. Just remove 'core' and import CachedSession directly from requests_cache

@JWCook
Copy link

JWCook commented May 7, 2021

You can blame me for that one, sorry! The intent for this was to raise a DeprecationWarning instead of causing an error. This would have worked if imported as from requests_cache.core import CachedSession; using requests_cache.core.CachedSession wasn't something I thought of.

If you run into any more problems, feel free to create an issue on the requests-cache repo.

@rsmassey
Copy link

Hi, I'm having the same problem, but I'm not sure how to solve it.

@SukiCZ
Copy link

SukiCZ commented Jan 25, 2024

Hi @rsmassey

As stated in the last commit 37f74d9 the maintainer will not continue his work so I've created a fork here, the library can be installed from PyPi with updated docs and more.

Feel free to install updated library instead (pip install bgg-api), that should fix your issue. Contributions are welcome ❤️ thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants