Redis LPOP wrong number of arguments in Python
Asked Answered
S

1

5

I have a simple Redis command that does the following:

redis_conn.lpop(queue_name, batch_size)

According to the Redis documentation and their Python SDK documentation, this should be a valid request. And, yet, I get the following error:

redis.exceptions.ResponseError: wrong number of arguments for 'lpop' command

Maybe I'm being obtuse and making a noobie mistake because it's 2:00AM but, this should work. So why doesn't it?

Sanyu answered 23/11, 2021 at 17:2 Comment(0)
S
11

Well, I was being obtuse. The documentation I linked states that the count argument is available from version 6.2. However, since I'm running Windows I don't get the newest version, ergo the failure.

Sanyu answered 23/11, 2021 at 17:9 Comment(4)
I was about to comment asking what your versions of Redis, redis-py, and Python are. Glad that my thinking was going down the correct path. Generally when there's a weird mismatch from the documentation like this, it's from something being a different version than the documentation, in my experience.Swanky
@RandomDavis Agreed. I can't tell you how many times I've been bitten by my outdated version of Redis. The woes of a Windows scrub :(Sanyu
You can always use WSL if you want to run Linux software via Windows. Should allow you to run the latest version of Redis. I used WSL to run the Linux version of Git on my Windows machine, and because it uses a Linux filesystem, it's able to do certain operations many many times faster. So it's not necessarily going to impact performance.Swanky
Only if you can enable Hypervisor, which I cannot as I'm running Windows HomeSanyu

© 2022 - 2024 — McMap. All rights reserved.