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

ModuleNotFoundError: No module named ‘async-timeout’ for python version > 3.11.2 #3105

Closed
mmick78 opened this issue Jan 9, 2024 · 3 comments

Comments

@mmick78
Copy link

mmick78 commented Jan 9, 2024

Version: What redis-py and what redis version is the issue happening on?
sync part of redis-py and version 5.0.1

Platform: What platform / version? (For example Python 3.5.1 on Windows 7 / Ubuntu 15.10 / Azure)
Python 3.11.5, arm AWS Lambda

Our dependencies:

[tool.poetry.dependencies]
python = "==3.11.5"
redis = "==5.0.1"
sentry-sdk = "==1.39.1"
requests = "==2.31.0"

[tool.poetry.dev-dependencies]
redislite = "^6.2.912183"

Description: Description of your issue, stack traces from errors and code that reproduces the issue
Issue we are facing while we are doing full sync code not requiring anything "async":

ModuleNotFoundError: No module named ‘async-timeout’

After checking out where it was used, the only reference we found was in our poetry.lock file (we use poetry as a package installer) and we found out where it comes from:

[[package]]
name = "redis"
version = "5.0.1"
description = "Python client for Redis database and key-value store"
optional = false
python-versions = ">=3.7"
files = [
    {file = "redis-5.0.1-py3-none-any.whl", hash = "sha256:ed4802971884ae19d640775ba3b03aa2e7bd5e8fb8dfaed2decce4d0fc48391f"},
    {file = "redis-5.0.1.tar.gz", hash = "sha256:0dab495cd5753069d3bc650a0dde8a8f9edde16fc5691b689a566eda58100d0f"},
]

[package.dependencies]
async-timeout = {version = ">=4.0.2", markers = "python_full_version <= \"3.11.2\""}

Checking out setup.py in this repo we found the same thing:
https://github.com/redis/redis-py/blob/master/setup.py#L39

It seems that due to the fact that we are using a python version higher than 3.11.2 (we use 3.11.5, any reason for locking it to 3.11.2 ?) we end up facing that issue even though we don't actually need that dependency at all.

Would it be possible to allow higher python version so that it doesn't potentially affect other users (in other projects we were not impacted due to having aiohttp installing it by default )
Work around we did: We put async-timeout as an explicit dependency to avoid being blocked

Thanks in advance

@dvora-h
Copy link
Collaborator

dvora-h commented Jan 15, 2024

#3109 should fix this

@Zaczero
Copy link
Contributor

Zaczero commented Mar 7, 2024

Hey @mmick78, Could you please provide a more detailed stack trace? It's very unusual to see module name with a dash "No module named ‘async-timeout’". If the error happened during runtime it would be "async_timeout" (example). I believe you faced an installation issue.

@zalmane
Copy link

zalmane commented Dec 4, 2024

This needs to be reopened. Seems that we bring async-timeout in the setup.py instead of async_timeout resulting in failure in older python versions (e.g. 3.7).

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

4 participants