I am trying to follow this basic django channels tutorial and I've gotten a pretty good start. I am able to successfully connect to my websocket and my consumer is properly echoing back to the front end when it receives a message.
The next part of the tutorial is focused on using channels_redis
in order to allow multile channels to all receive the same message so that different client instances can communicate with each other via the websockets.
In the tutorial they say to run
pip3 install channels_redis
and they don't elaborate any or provide any troubleshooting if this fails.
When I run this command on my windows machine (Python 3.7 32bit) I get the following stacktrace:
Installing collected packages: hiredis, aioredis, channels-redis
Running setup.py install for hiredis ... error
Complete output from command C:\work_repos\WebWorkspace\PersonQueue\venv\Scr
ipts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\o_O\\App
Data\\Local\\Temp\\pip-build-vk3mqeh1\\hiredis\\setup.py';f=getattr(tokenize, 'o
pen', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile
(code, __file__, 'exec'))" install --record C:\Users\o_O\AppData\Local\Temp\pip-
dyn4y_6y-record\install-record.txt --single-version-externally-managed --compile
--install-headers C:\work_repos\WebWorkspace\PersonQueue\venv\include\site\pyth
on3.7\hiredis:
running install
running build
running build_py
creating build
creating build\lib.win32-3.7
creating build\lib.win32-3.7\hiredis
copying hiredis\version.py -> build\lib.win32-3.7\hiredis
copying hiredis\__init__.py -> build\lib.win32-3.7\hiredis
running build_clib
building 'hiredis_for_hiredis_py' library
creating build\temp.win32-3.7
creating build\temp.win32-3.7\vendor
creating build\temp.win32-3.7\vendor\hiredis
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC
\14.15.26726\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD "-IC:\Pr
ogram Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.15.26
726\include" /Tcvendor/hiredis/read.c /Fobuild\temp.win32-3.7\vendor/hiredis/rea
d.obj
read.c
vendor/hiredis/read.c(34): fatal error C1083: Cannot open include file: 'str
ing.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Buil
dTools\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX86\\x86\\cl.exe' failed with exi
t status 2
It seems to be an issue with a dependency hiredis
. Searching around online I have found others who have had trouble using hiredis on windows, but not much in the way of a solution.
So my question: Is it possible to use the channels_redis
package on windows? I know windows obviously does not make the best production deployment environment, but I am not intending to deploy on a windows server. At this point I am just trying to follow a basic tutorial and build out a simple proof of concept application that is capable of websocket communication. I do not have the option to use Linux on my development machine so I am looking specifically for a windows based solution.
Edit Additional Info:
- Windows 7
- Python 3.7
- Django 2.1
- channels 2.1.3
- I do have the Microsoft Build Tools installed