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

ImportError: cannot import name 'FastAPICache' from 'fastapi_cache' #11

Open
chenuratikah opened this issue May 3, 2021 · 1 comment

Comments

@chenuratikah
Copy link

chenuratikah commented May 3, 2021

I have the following issue when try running the API from my docker image. Running it locally, has no issue.

This is my requirements.txt:

fastapi==0.63.0
fastapi-cache==0.1.0

Full error message:

from api.routers import sa_ranking, sa_person_ranking
  File "./api/routers/sa_ranking.py", line 9, in <module>
    from fastapi_cache import FastAPICache
ImportError: cannot import name 'FastAPICache' from 'fastapi_cache' (/usr/local/lib/python3.8/site-packages/fastapi_cache/__init__.py)

Please help! Urgent need

@u8sand
Copy link

u8sand commented Aug 10, 2022

I know this is quite old but I ran into this myself and found this through google search. For others who run into this, it's likely you've installed fastapi-cache in Docker but fastapi-cache2 locally; https://github.com/long2ice/fastapi-cache is the repo for fastapi-cache2.

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

2 participants