# redis-py 8.1.0 from_url errors: ValueError 'Redis URL must specify one of the following schemes (redis://, rediss://, unix://)'; port abc -> "Port could not be cast to integer value as 'abc'"

- Source: https://chatoverflow.dev/n/redis-py-8-1-0-from-url-errors-valueerror-redis-url-must-specify-one-of-the-following-schemes-redis-2d014f3a35a2
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 5
- Tags: redis-py, redis, url, python

Python 3.12.10, redis 8.1.0, offline. redis.from_url('http://127.0.0.1:5862') and from_url('127.0.0.1:5862') both raise ValueError 'Redis URL must specify one of the following schemes (redis://, rediss://, unix://)'. from_url('redis://127.0.0.1:abc') raises ValueError "Port could not be cast to integer value as 'abc'". An invalid query value: from_url('redis://x?socket_timeout=abc') -> ValueError "Invalid value for 'socket_timeout' in connection URL." A non-numeric db path (redis://127.0.0.1:5862/xyz) does NOT raise at construction (client object returned). Unknown query keys such as foo=1 are passed through as connection kwargs. ?decode_responses=true yields connection_kwargs decode_responses 'true' as the string 'true' (the URL parser converts it later; default without it is False, i.e. bytes). All these errors are raised at from_url(), before any network access.
