[ErpNext]No module named 'redis.commands'

Hello everyone,
I am installing erpnext 14 under a docker container (Debian 12) - Windows Server 2022 with Vs Code, I followed all the steps without problem until step:
bench get-app --branch version-14 erpnext
It always shows me the error message on the terminal:

….
File “/workspace/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py”, line 7, in
from redis.commands.search import Search
ModuleNotFoundError: No module named ‘redis.commands’
ERROR: bench build --app erpnext
subprocess.CalledProcessError: Command ‘bench build --app erpnext’ returned non-zero exit status 1.

To solve this problem I tried a lot of solutions:

  1. pip install redis
  2. apt install redis-server
  3. sudo apt-get install python3.10-venv

No luck, there is a trick to fix this anomaly.
Regards.

You are using nightly version of framework with version-14 of ERPNext. Use same branches for both and it will work.

1 Like

Thank you for your reply.
Indeed, before seeing your answer, I redid the whole installation when I found that there is a new version of frappe container put yesterday, and I ensured the installation of the latest version of the framework frappe “version 14” with command:
**bench init --skip-redis-config-generation --strike-branch version-14 strike-bench**

And oddly everything went smoothly.
conclusion: Frappe 14 ==> ErpNext 14.
THANKS

Facing the same issue, so I need to reinstall Frappe with the command you suggested. Right?

Initialised and installed ERPNext successfully but while entering bench start, getting this error

11:27:18 system     | watch.1 started (pid=3527)
11:27:18 system     | socketio.1 started (pid=3526)
11:27:18 system     | web.1 started (pid=3523)
11:27:18 system     | schedule.1 started (pid=3528)
11:27:18 system     | worker.1 started (pid=3535)
11:27:19 socketio.1 | node:events:492
11:27:19 socketio.1 |       throw er; // Unhandled 'error' event
11:27:19 socketio.1 |       ^
11:27:19 socketio.1 |
11:27:19 socketio.1 | Error: connect ECONNREFUSED 127.0.0.1:12000
11:27:19 socketio.1 |     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1595:16)
11:27:19 socketio.1 | Emitted 'error' event on RedisClient instance at:
11:27:19 socketio.1 |     at RedisClient.on_error (/home/developer/frappe-bench/apps/frappe/node_modules/redis/index.js:342:14)
11:27:19 socketio.1 |     at Socket.<anonymous> (/home/developer/frappe-bench/apps/frappe/node_modules/redis/index.js:223:14)
11:27:19 socketio.1 |     at Socket.emit (node:events:514:28)
11:27:19 socketio.1 |     at emitErrorNT (node:internal/streams/destroy:151:8)
11:27:19 socketio.1 |     at emitErrorCloseNT (node:internal/streams/destroy:116:3)
11:27:19 socketio.1 |     at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
11:27:19 socketio.1 |   errno: -111,
11:27:19 socketio.1 |   code: 'ECONNREFUSED',
11:27:19 socketio.1 |   syscall: 'connect',
11:27:19 socketio.1 |   address: '127.0.0.1',
11:27:19 socketio.1 |   port: 12000
11:27:19 socketio.1 | }
11:27:19 socketio.1 |
11:27:19 socketio.1 | Node.js v20.5.0
11:27:19 system     | socketio.1 stopped (rc=1)
11:27:19 system     | sending SIGTERM to web.1 (pid 3523)
11:27:19 system     | sending SIGTERM to watch.1 (pid 3527)
11:27:19 system     | sending SIGTERM to schedule.1 (pid 3528)
11:27:19 system     | sending SIGTERM to worker.1 (pid 3535)
11:27:19 system     | worker.1 stopped (rc=-15)
11:27:19 system     | schedule.1 stopped (rc=-15)
11:27:19 system     | web.1 stopped (rc=-15)
11:27:19 system     | watch.1 stopped (rc=-15)

am I doing something wrong?