Error with visual studio build tools msvc while downloading paddleocr

Nayel Hashmi 1 Reputation point
2022-11-16T15:20:17.397+00:00

I get this error and the code exits when downloading paddleocr. (Cannot build wheel I suppose)
I am using Visual Studio Code and I have tried VS build tools 2017, 2019, 2022, but I cannot successfully install paddleocr.

× Building wheel for lanms-neo (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [18 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-310
creating build\lib.win-amd64-cpython-310\lanms
copying lanms__init__.py -> build\lib.win-amd64-cpython-310\lanms
running build_ext
building 'lanms._C' extension
creating build\temp.win-amd64-cpython-310
creating build\temp.win-amd64-cpython-310\Release
creating build\temp.win-amd64-cpython-310\Release\lanms
creating build\temp.win-amd64-cpython-310\Release\lanms\csrc
creating build\temp.win-amd64-cpython-310\Release\lanms\csrc\clipper
"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\hashm\AppData\Local\Temp\pip-install-1o2mkp67\lanms-neo_66c5d4de214a403c98599318fd36b821\lanms\csrc -IC:\Users\hashm\AppData\Local\Temp\pip-build-env-hsvxstut\overlay\Lib\site-packages\pybind11\include -IC:\Users\hashm\miniconda3\envs\paddlenew\include -IC:\Users\hashm\miniconda3\envs\paddlenew\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include" /EHsc /Tplanms/csrc/clipper\clipper.cpp /Fobuild\temp.win-amd64-cpython-310\Release\lanms/csrc/clipper\clipper.obj /std:c++latest /EHsc /bigobj
clipper.cpp
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include\crtdefs.h(10): fatal error C1083: Cannot open
include file: 'corecrt.h': No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe' failed with exit code 2
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for lanms-neo
Building wheel for Polygon3 (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [20 lines of output]
Using NumPy extension!
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-310
creating build\lib.win-amd64-cpython-310\Polygon
copying Polygon\IO.py -> build\lib.win-amd64-cpython-310\Polygon
copying Polygon\Shapes.py -> build\lib.win-amd64-cpython-310\Polygon
copying Polygon\Utils.py -> build\lib.win-amd64-cpython-310\Polygon
copying Polygon__init__.py -> build\lib.win-amd64-cpython-310\Polygon
running build_ext
building 'Polygon.cPolygon' extension
creating build\temp.win-amd64-cpython-310
creating build\temp.win-amd64-cpython-310\Release
creating build\temp.win-amd64-cpython-310\Release\src
"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DDEFAULT_STYLE=STYLE_LIST -DWITH_NUMPY=1 -DSYSTEM_WIN32=1 -Isrc -IC:\Users\hashm\miniconda3\envs\paddlenew\lib\site-packages\numpy\core\include -IC:\Users\hashm\miniconda3\envs\paddlenew\include -IC:\Users\hashm\miniconda3\envs\paddlenew\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include" /Tcsrc/PolyUtil.c /Fobuild\temp.win-amd64-cpython-310\Release\src/PolyUtil.obj
PolyUtil.c
c:\users\hashm\appdata\local\temp\pip-install-1o2mkp67\polygon3_b44d80ca5d45474bae4cb9f6604164ba\src\gpc.h(36): fatal error C1083: Cannot open
include file: 'stdio.h': No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe' failed with exit code 2
[end of output]

Developer technologies Visual Studio Debugging
Community Center Not monitored
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 34,436 Reputation points Microsoft External Staff
    2022-11-23T06:07:21.553+00:00

    Hi @Nayel Hashmi ,

    The error message indicates that some include files cannot be found. Probably you miss some components.

    Did you select to install some individual components? I may suggest you try to install "Windows Universal CRT SDK" and "Windows 10/11 SDK (XX.X.XXXXX.X)"(maybe the latest version) from VS Installer > Visual Studio Build Tools > Modify > Individual components.

    Best Regards,
    Tianyu

    • If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
      Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.