-
Notifications
You must be signed in to change notification settings - Fork 511
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
[Bug]: Failed to import gptcache due to missing redis dependency #521
Comments
It was because the |
Hi @a9raag! I landed here searching for a solution to this problem, so I guess it's still not solved. 😞 I have not much context about this project, but checking the code I'd say that the problem is in this line, where we are importing the As the class is only loaded to check a condition, would it be possible to change that condition to avoid importing the class at the very top level? I don't know if it's possible to find another way to decide if the condition is true, or check first if Thanks! |
@a9raag I've created this PR trying to solve the issue. As |
@marioluan i have merged it to dev branch |
Thanks @SimFG!! ❤️ |
Current Behavior
Importing gptcache fails in environments where redis is not installed (because its not declared as a required dependency) and it can't be installed (e.g. read only filesystem such as AWS lambda).
Expected Behavior
gptcache shouldn't attempt to install packages on the user's behalf.
mandatory packages should be declared in requirements.txt/setup.py and optional features should be enabled only when said packages are available, raising an error at runtime if that functionality is attempted without the required packages
Steps To Reproduce
Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: