Failed to build httptools, how to fix it

Viewed 698

when I try to install FAST API (https://fastapi.tiangolo.com/tutorial /). im using Python 3.10.2, Pycharm I get the following error with httptools. I have already installed build tools which is given by the link. and updated setuptools, wheel and pip using

pip install --upgrade pip setuptools wheel

but I still get this error:

Building wheels for collected packages: httptools<br />
  Building wheel for httptools (setup.py) ... error<br />
  error: subprocess-exited-with-error<br />

  × python setup.py bdist_wheel did not run successfully.<br />
  │ exit code: 1<br />
  ╰─> [25 lines of output]<br />
      running bdist_wheel<br />
      running build<br />
      running build_py<br />
      creating build<br />
      creating build\lib.win-amd64-3.10<br />
      creating build\lib.win-amd64-3.10\httptools<br />
      copying httptools\_version.py -> build\lib.win-amd64-3.10\httptools<br />
      copying httptools\__init__.py -> build\lib.win-amd64-3.10\httptools<br />
      creating build\lib.win-amd64-3.10\httptools\parser<br />
      copying httptools\parser\errors.py -> build\lib.win-amd64-3.10\httptools\parser<br />
      copying httptools\parser\__init__.py -> build\lib.win-amd64-3.10\httptools\parser<br />
      running egg_info<br />
      writing httptools.egg-info\PKG-INFO<br />
      writing dependency_links to httptools.egg-info\dependency_links.txt<br />
      writing requirements to httptools.egg-info\requires.txt<br />
      writing top-level names to httptools.egg-info\top_level.txt<br />
      reading manifest file 'httptools.egg-info\SOURCES.txt'<br />
      reading manifest template 'MANIFEST.in'<br />
      adding license file 'LICENSE'<br />
      writing manifest file 'httptools.egg-info\SOURCES.txt'<br />
      copying httptools\parser\parser.c -> build\lib.win-amd64-3.10\httptools\parser<br />
      copying httptools\parser\url_parser.c -> build\lib.win-amd64-3.10\httptools\parser<br />
      running build_ext<br />
      building 'httptools.parser.parser' extension<br />
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/<br />
      [end of output]<br />
<br />
  note: This error originates from a subprocess, and is likely not a problem with pip.<br />
  ERROR: Failed building wheel for httptools<br />
  Running setup.py clean for httptools<br />
Failed to build httptools<br />
Installing collected packages: httptools, certifi, ujson, python-multipart, orjson, jinja2, itsdangerous, dnspython, charset-normalizer, requests, email_validator, fastapi
  Running setup.py install for httptools ... error<br />
  error: subprocess-exited-with-error<br />
<br />
  × Running setup.py install for httptools did not run successfully.<br />
  │ exit code: 1<br />
  ╰─> [27 lines of output]<br />
      running install<br />
      c:\users\ghali\pycharmprojects\tat\venv\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and ot
her standards-based tools.<br />
        warnings.warn(<br />
      running build<br />
      running build_py<br />
      creating build<br />
      creating build\lib.win-amd64-3.10<br />
      creating build\lib.win-amd64-3.10\httptools<br />
      copying httptools\_version.py -> build\lib.win-amd64-3.10\httptools<br />
      copying httptools\__init__.py -> build\lib.win-amd64-3.10\httptools<br />
      creating build\lib.win-amd64-3.10\httptools\parser<br />
      copying httptools\parser\errors.py -> build\lib.win-amd64-3.10\httptools\parser<br />
      copying httptools\parser\__init__.py -> build\lib.win-amd64-3.10\httptools\parser<br />
      running egg_info<br />
      writing httptools.egg-info\PKG-INFO<br />
      writing dependency_links to httptools.egg-info\dependency_links.txt<br />
      writing requirements to httptools.egg-info\requires.txt<br />
      writing top-level names to httptools.egg-info\top_level.txt<br />
      reading manifest file 'httptools.egg-info\SOURCES.txt'<br />
      reading manifest template 'MANIFEST.in'<br />
      adding license file 'LICENSE'<br />
      writing manifest file 'httptools.egg-info\SOURCES.txt'<br />
      copying httptools\parser\parser.c -> build\lib.win-amd64-3.10\httptools\parser<br />
      copying httptools\parser\url_parser.c -> build\lib.win-amd64-3.10\httptools\parser<br />
      running build_ext<br />
      building 'httptools.parser.parser' extension<br />
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/<br />
      [end of output]<br />
<br />
  note: This error originates from a subprocess, and is likely not a problem with pip.<br />
error: legacy-install-failure<br />
<br />
× Encountered error while trying to install package.<br />
╰─> httptools<br />
<br />
note: This is an issue with the package mentioned above, not pip<br />.
hint: See above for output from the failure.<br />
1 Answers

Unfortunately I couldn't solve this problem using python 3.10
The only thing that helped me was rolling back to python 3.8.6 (it will probably work in python 3.9 as well)
As far as I understand, the problem is the incompatibility of the current version of httptools and python 3.10 If anyone finds a solution, be sure to write. I will wait.

Related