Installation issue in windows

Hi Team,
I am trying to install Sanic into my windows system with using “pip3 install sanic” command. I am using latest Python latest version(3.7.4).
But i am getting below error.
C:\Users\ragu>pip3 install sanic
Collecting sanic
Using cached https://files.pythonhosted.org/packages/13/89/351f12a0f46a68ba9507813f7373b6440e02acc5057ff93744edcf1abf3c/sanic-19.6.2-py3-none-any.whl
Requirement already satisfied: websockets<7.0,>=6.0 in c:\users\rmaniraj\appdata\local\programs\python\python37\lib\site-packages (from sanic) (6.0)
Requirement already satisfied: requests-async==0.5.0 in c:\users\rmaniraj\appdata\local\programs\python\python37\lib\site-packages (from sanic) (0.5.0)
Requirement already satisfied: aiofiles>=0.3.0 in c:\users\rmaniraj\appdata\local\programs\python\python37\lib\site-packages (from sanic) (0.4.0)
Collecting httptools>=0.0.10 (from sanic)
Using cached https://files.pythonhosted.org/packages/1b/03/215969db11abe8741e9c266a4cbe803a372bd86dd35fa0084c4df6d4bd00/httptools-0.0.13.tar.gz
Requirement already satisfied: multidict<5.0,>=4.0 in c:\users\rmaniraj\appdata\local\programs\python\python37\lib\site-packages (from sanic) (4.5.2)
Requirement already satisfied: requests==2.* in c:\users\rmaniraj\appdata\local\programs\python\python37\lib\site-packages (from requests-async==0.5.0->sanic) (2.22.0)
Requirement already satisfied: httpcore==0.3.* in c:\users\rmaniraj\appdata\local\programs\python\python37\lib\site-packages (from requests-async==0.5.0->sanic) (0.3.0)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\rmaniraj\appdata\local\programs\python\python37\lib\site-packages (from requests==2.->requests-async==0.5.0->sanic) (2019.6.16)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in c:\users\rmaniraj\appdata\local\programs\python\python37\lib\site-packages (from requests==2.
->requests-async==0.5.0->sanic) (1.25.3)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in c:\users\rmaniraj\appdata\local\programs\python\python37\lib\site-packages (from requests==2.->requests-async==0.5.0->sanic) (3.0.4)
Requirement already satisfied: idna<2.9,>=2.5 in c:\users\rmaniraj\appdata\local\programs\python\python37\lib\site-packages (from requests==2.
->requests-async==0.5.0->sanic) (2.8)
Requirement already satisfied: h11==0.8.* in c:\users\rmaniraj\appdata\local\programs\python\python37\lib\site-packages (from httpcore==0.3.->requests-async==0.5.0->sanic) (0.8.1)
Requirement already satisfied: h2==3.
in c:\users\rmaniraj\appdata\local\programs\python\python37\lib\site-packages (from httpcore==0.3.->requests-async==0.5.0->sanic) (3.1.1)
Requirement already satisfied: rfc3986==1.
in c:\users\rmaniraj\appdata\local\programs\python\python37\lib\site-packages (from httpcore==0.3.->requests-async==0.5.0->sanic) (1.3.2)
Requirement already satisfied: hyperframe<6,>=5.2.0 in c:\users\rmaniraj\appdata\local\programs\python\python37\lib\site-packages (from h2==3.
->httpcore==0.3.->requests-async==0.5.0->sanic) (5.2.0)
Requirement already satisfied: hpack<4,>=2.3 in c:\users\rmaniraj\appdata\local\programs\python\python37\lib\site-packages (from h2==3.
->httpcore==0.3.*->requests-async==0.5.0->sanic) (3.0.0)
Installing collected packages: httptools, sanic
Running setup.py install for httptools … error
ERROR: Command errored out with exit status 1:
command: ‘c:\users\rmaniraj\appdata\local\programs\python\python37\python.exe’ -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"‘C:\Users\rmaniraj\AppData\Local\Temp\pip-install-vnzz3967\httptools\setup.py’"’"’; file=’"’"‘C:\Users\rmaniraj\AppData\Local\Temp\pip-install-vnzz3967\httptools\setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ install --record ‘C:\Users\rmaniraj\AppData\Local\Temp\pip-record-z9f4k2p5\install-record.txt’ --single-version-externally-managed --compile
cwd: C:\Users\rmaniraj\AppData\Local\Temp\pip-install-vnzz3967\httptools
Complete output (21 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\httptools
copying httptools_init_.py -> build\lib.win-amd64-3.7\httptools
creating build\lib.win-amd64-3.7\httptools\parser
copying httptools\parser\errors.py -> build\lib.win-amd64-3.7\httptools\parser
copying httptools\parser_init_.py -> build\lib.win-amd64-3.7\httptools\parser
running egg_info
writing httptools.egg-info\PKG-INFO
writing dependency_links to httptools.egg-info\dependency_links.txt
writing top-level names to httptools.egg-info\top_level.txt
reading manifest file ‘httptools.egg-info\SOURCES.txt’
reading manifest template ‘MANIFEST.in’
writing manifest file ‘httptools.egg-info\SOURCES.txt’
copying httptools\parser\parser.c -> build\lib.win-amd64-3.7\httptools\parser
running build_ext
building ‘httptools.parser.parser’ extension
error: [WinError 3] The system cannot find the path specified: ‘C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\PlatformSDK\lib’
----------------------------------------
ERROR: Command errored out with exit status 1: ‘c:\users\rmaniraj\appdata\local\programs\python\python37\python.exe’ -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"‘C:\Users\rmaniraj\AppData\Local\Temp\pip-install-vnzz3967\httptools\setup.py’"’"’; file=’"’"‘C:\Users\rmaniraj\AppData\Local\Temp\pip-install-vnzz3967\httptools\setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ install --record ‘C:\Users\rmaniraj\AppData\Local\Temp\pip-record-z9f4k2p5\install-record.txt’ --single-version-externally-managed --compile Check the logs for full command output.

The problem is with the installation of httptools, not Sanic.
You basically have two options - install httptools using wheel file or installing Visual C++ Build Tools so httptools could be compiled on your computer.

Visual C++ Build Tools is part of Microsoft Visual Studio. It is free but requires 6GB of space. Long download and installation time.

Finding a wheel file for httptools is not an easy task too. I don’t know where to get one.

Github page of httptools have 3 similar opened issues - https://github.com/MagicStack/httptools/issues

I had a similar problem and ended up installing C++ Build Tools

yea this solution isn’t ideal but I tend to do

choco
    install \
    -y \
    --force \
    visualstudio2017community \
    --package-parameters
    --passive \
    --add Microsoft.VisualStudio.Component.VC.140 \
    --add Microsoft.VisualStudio.ComponentGroup.nativeDesktop.Win81 \
    --add Microsoft.Component.VC.Runtime.UCRTSDK

and then your pip install should work