Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2

I am trying to pack py code with cython, however when I am running python setup.py build_ext --inplace, command prompt shows:

Anaconda3\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2

I do have Visual Studio(2017 and 2019) and Build Tools as well; In the command prompt I did:

set LIB=C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt
set INCLUDE=C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt

before running python setup.py, also tried to run in the VS Studio Administrator: Windowds PowerShell and still the same issue.

And also when I am trying to run %VS140COMNTOOLS%vsvars32.batcommand prompt shows:

ERROR: Cannot determine the location of the VS Common Tools folder.
like image 603
doppelherz7 Avatar asked Nov 18 '25 12:11

doppelherz7


1 Answers

I had the same issue and I fixed it by :

  1. install python-3.11.2-amd64.exe (to fix many prbl like err cl.exe code 2) and check if the problem gone if not go to the next steps :
  2. download VISUAL COMMUNITY 2022 installer
  3. run .exe and pick PYTHON DEVELOPMENT in the left side
  4. in the right side: pick and download python native development tools option
  5. pick and download python web option
  6. start downloading and installations
  7. run pip install setuptools
  8. run pip --upgrade setuptools
  9. run pip install -your package-
like image 71
aslan aslan Avatar answered Nov 21 '25 01:11

aslan aslan