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

"No module named 'redis.asyncio'" when trying to build with docker #745

Closed
Eli-Chandler opened this issue Jul 14, 2023 · 1 comment
Closed

Comments

@Eli-Chandler
Copy link

repninjaproduct3-web-1  | Traceback (most recent call last):
repninjaproduct3-web-1  |   File "/usr/local/bin/hypercorn", line 8, in <module>
repninjaproduct3-web-1  |     sys.exit(main())
repninjaproduct3-web-1  |              ^^^^^^
repninjaproduct3-web-1  |   File "/usr/local/lib/python3.11/site-packages/hypercorn/__main__.py", line 287, in main
repninjaproduct3-web-1  |     run(config)
repninjaproduct3-web-1  |   File "/usr/local/lib/python3.11/site-packages/hypercorn/run.py", line 41, in run
repninjaproduct3-web-1  |     load_application(config.application_path, config.wsgi_max_body_size)
repninjaproduct3-web-1  |   File "/usr/local/lib/python3.11/site-packages/hypercorn/utils.py", line 115, in load_application
repninjaproduct3-web-1  |     module = import_module(import_name)
repninjaproduct3-web-1  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^
repninjaproduct3-web-1  |   File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
repninjaproduct3-web-1  |     return _bootstrap._gcd_import(name[level:], package, level)
repninjaproduct3-web-1  |            ^^^^^
repninjaproduct3-web-1  | ^^^^^^^^^^^^^^^^
repninjaproduct3-web-1  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
repninjaproduct3-web-1  | ^^^
repninjaproduct3-web-1  |   File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
repninjaproduct3-web-1  |   File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
repninjaproduct3-web-1  |   File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
repninjaproduct3-web-1  |   File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
repninjaproduct3-web-1  |   File "<frozen importlib._bootstrap_external>", line 940, in exec_module
repninjaproduct3-web-1  |   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
repninjaproduct3-web-1  |   File "/qcphotos/app.py", line 18, in <module>
repninjaproduct3-web-1  |     from aiocache import Cache
repninjaproduct3-web-1  |   File "/usr/local/lib/python3.11/site-packages/aiocache/__init__.py", line 18, in <module>
repninjaproduct3-web-1  |     from aiocache.backends.redis import RedisCache
repninjaproduct3-web-1  |   File "/usr/local/lib/python3.11/site-packages/aiocache/backends/redis.py", line 4, in <module>
repninjaproduct3-web-1  |     import redis.asyncio as redis
repninjaproduct3-web-1  | ModuleNotFoundError: No module named 'redis.asyncio'

My requirements.txt has aiocache==0.12.1 and redis==3.5.3
I managed to fix this issue in pycharm by following this guide redis/redis-py#2221
but the issue persists when trying to build with docker

@Eli-Chandler
Copy link
Author

pip install --disable-pip-version-check redis==4.6.0 fixed this issue for me, seems that one of my packages was forcing redis<4.0, and for whatever reason pip wasn't picking up that this requires 4.6.0

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

1 participant