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]
Visual Studio:
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
Debugging:
The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
I followed their tutorial online, installed paddlepaddle first in a new conda environment. I already have visual studio build tools, and tried to upgrade and downgrade versions of it, even tried downgrading python but the error persists.
I put in the command: pip install paddleocr, it downloads packages but exits with error of "could not build lanms-neo and Polygon3" as shown in my question above.
Hi
@Nayel Hashmi
,
May I know if your issue is resolved? Please let me know if there is anything that I can help here.
Regards,
Tianyu
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.