V15 Install Error. ModuleNotFoundError: No module named 'async_timeout'

I am installing on WSL

bench init frappe-v15 --frappe-branch version-15-beta
Setting Up Environment
$ python3 -m venv env
$ /home/frappe/frappe-v15/env/bin/python -m pip install --quiet --upgrade pip
$ /home/frappe/frappe-v15/env/bin/python -m pip install --quiet wheel
Getting frappe
$ git clone https://github.com/frappe/frappe.git --branch version-15-beta --depth 1 --origin upstream
Cloning into 'frappe'...
remote: Enumerating objects: 3248, done.
remote: Counting objects: 100% (3248/3248), done.
remote: Compressing objects: 100% (2860/2860), done.
remote: Total 3248 (delta 422), reused 1834 (delta 276), pack-reused 0
Receiving objects: 100% (3248/3248), 17.32 MiB | 371.00 KiB/s, done.
Resolving deltas: 100% (422/422), done.
Installing frappe
$ /home/frappe/frappe-v15/env/bin/python -m pip install --quiet --upgrade -e /home/frappe/frappe-v15/apps/frappe
$ yarn install
yarn install v1.22.19
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
[4/5] Linking dependencies...
warning " > @frappe/esbuild-plugin-postcss2@0.1.3" has unmet peer dependency "less@^4.x".
warning " > @frappe/esbuild-plugin-postcss2@0.1.3" has unmet peer dependency "stylus@^0.x".
warning " > @vue/component-compiler@4.2.4" has unmet peer dependency "vue-template-compiler@*".
[5/5] Building fresh packages...
Done in 4.68s.
Found existing apps updating states...
WARN: restart failed: Couldn't find supervisorctl in PATH
$ bench build
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/frappe/frappe-v15/apps/frappe/frappe/utils/bench_helper.py", line 114, in <module>
    main()
  File "/home/frappe/frappe-v15/apps/frappe/frappe/utils/bench_helper.py", line 20, in main
    click.Group(commands=commands)(prog_name="bench")
  File "/home/frappe/frappe-v15/env/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/frappe/frappe-v15/env/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/frappe/frappe-v15/env/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/frappe/frappe-v15/env/lib/python3.11/site-packages/click/core.py", line 1685, in invoke
    super().invoke(ctx)
  File "/home/frappe/frappe-v15/env/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/frappe/frappe-v15/env/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/frappe/frappe-v15/env/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/frappe/frappe-v15/apps/frappe/frappe/utils/bench_helper.py", line 44, in app_group
    ctx.obj = {"sites": get_sites(site), "force": force, "verbose": verbose, "profile": profile}
                        ^^^^^^^^^^^^^^^
  File "/home/frappe/frappe-v15/apps/frappe/frappe/utils/bench_helper.py", line 56, in get_sites
    elif default_site := frappe.get_conf().default_site:
                         ^^^^^^^^^^^^^^^^^
  File "/home/frappe/frappe-v15/apps/frappe/frappe/__init__.py", line 372, in get_conf
    with init_site(site):
  File "/home/frappe/frappe-v15/apps/frappe/frappe/__init__.py", line 382, in __enter__
    init(self.site)
  File "/home/frappe/frappe-v15/apps/frappe/frappe/__init__.py", line 245, in init
    setup_redis_cache_connection()
  File "/home/frappe/frappe-v15/apps/frappe/frappe/__init__.py", line 402, in setup_redis_cache_connection
    from frappe.utils.redis_wrapper import RedisWrapper
  File "/home/frappe/frappe-v15/apps/frappe/frappe/utils/redis_wrapper.py", line 7, in <module>
    from redis.commands.search import Search
  File "/home/frappe/frappe-v15/env/lib/python3.11/site-packages/redis/commands/search/__init__.py", line 3, in <module>
    from ...asyncio.client import Pipeline as AsyncioPipeline
  File "/home/frappe/frappe-v15/env/lib/python3.11/site-packages/redis/asyncio/__init__.py", line 1, in <module>
    from redis.asyncio.client import Redis, StrictRedis
  File "/home/frappe/frappe-v15/env/lib/python3.11/site-packages/redis/asyncio/client.py", line 27, in <module>
    from redis.asyncio.connection import (
  File "/home/frappe/frappe-v15/env/lib/python3.11/site-packages/redis/asyncio/connection.py", line 33, in <module>
    from async_timeout import timeout as async_timeout
ModuleNotFoundError: No module named 'async_timeout'
subprocess.CalledProcessError: Command 'bench build' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/dist-packages/bench/commands/make.py", line 68, in init
    init(
  File "/usr/local/lib/python3.11/dist-packages/bench/utils/render.py", line 105, in wrapper_fn
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/bench/utils/system.py", line 104, in init
    build_assets(bench_path=path)
  File "/usr/local/lib/python3.11/dist-packages/bench/utils/bench.py", line 351, in build_assets
    exec_cmd(command, cwd=bench_path, env={"BENCH_DEVELOPER": "1"})
  File "/usr/local/lib/python3.11/dist-packages/bench/utils/__init__.py", line 158, in exec_cmd
    raise CommandFailedError(cmd) from subprocess.CalledProcessError(return_code, cmd)
bench.exceptions.CommandFailedError: bench build

ERROR: There was a problem while creating frappe-v15

After this I chose not to rollback and attempted the following commands:

  1. Activate your virtual environment:
    source /home/frappe/frappe-v15/env/bin/activate
    
  2. Install the missing async_timeout module:
    pip install async-timeout
    
  3. Once the installation is complete, try running bench build again:
    bench build
    

After that Build was successful and even I tested further by creating new site and it worked as normal.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.