Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installing python3 with vcpkg on windows 10 is failing with error "io.h" not found #7128

Closed
singh0506 opened this issue Jul 2, 2019 · 16 comments
Labels
requires:repro The issue is not currently repro-able

Comments

@singh0506
Copy link

No description provided.

@singh0506
Copy link
Author

Building python3 using vcpkg, getting below console error.
Also please find attached log.
build-x64-windows-rel-out.log

please help me to resolve this asap.

note: using VS2019 preview .

Building package python3[core]:x64-windows...
-- Downloading https://github.com/python/cpython/archive/v3.7.3.tar.gz...
-- Extracting source C:/workspaceforvcpkg/vcpkg/downloads/python-cpython-v3.7.3.tar.gz
-- Using source at C:/workspaceforvcpkg/vcpkg/buildtrees/python3/src/v3.7.3-1161ad7a91
-- Building C:/workspaceforvcpkg/vcpkg/buildtrees/python3/src/v3.7.3-1161ad7a91-Lib-dynamic-crt-dynamic/PCBuild/pythoncore.vcxproj for Release
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:56 (message):
Command failed: msbuild;C:/workspaceforvcpkg/vcpkg/buildtrees/python3/src/v3.7.3-1161ad7a91-Lib-dynamic-crt-dynamic/PCBuild/pythoncore.vcxproj;/p:Configuration=Release;/t:Rebuild;/p:Platform=x64;/p:PlatformToolset=v142;/p:VCPkgLocalAppDataDisabled=true;/p:UseIntelMKL=No;/p:WindowsTargetPlatformVersion=;/m
Working Directory: C:/workspaceforvcpkg/vcpkg/buildtrees/python3/x64-windows-rel
Error code: 1
See logs for more information:
C:\workspaceforvcpkg\vcpkg\buildtrees\python3\build-x64-windows-rel-out.log

Call Stack (most recent call first):
scripts/cmake/vcpkg_build_msbuild.cmake:119 (vcpkg_execute_required_process)
ports/python3/portfile.cmake:37 (vcpkg_build_msbuild)
scripts/ports.cmake:71 (include)

Error: Building package python3:x64-windows failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with .\vcpkg update, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
Package: python3:x64-windows
Vcpkg version: 2018.11.23-nohash

Additionally, attach any relevant sections from the log files above.

@MVoz
Copy link
Contributor

MVoz commented Jul 2, 2019

#7115

no need to stamp complaints, you have problems with WinSDK

solve this problem and everything else will turn out

@singh0506
Copy link
Author

#7115 , this problem is coming on vs2017. But io.h file not found as problem not coming on vs2017.

now, I have uninstalled everything e.g. vs2017 and installed vs2019 preview. in this case, error is coming in building python3. this error was not encounter for vs2017.

so, i believe , both are different problem.

@MVoz
Copy link
Contributor

MVoz commented Jul 2, 2019

where $include:io.h

C:\Program Files (x86)\ Windows Kits\10 \Include\10.0.17763.0\ucrt\io.h

@singh0506
Copy link
Author

thanks voskrese.
c:\workspaceforvcpkg\vcpkg>where $include:io.h
INFO: Could not find files for the given pattern(s).

but not able to find that file with mentioned command , even if io.h file present in C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt

@PhoebeHui
Copy link
Contributor

@singh0506, please run '/vcpkg env --triplet x86-windows --debug' firstly, do you install windows sdk via vs installer?

Everything works correctly for me. I have vs2019 16.2.0 preview, windows sdk 18362 and latest vcpkg installed.
PS F:\vcpkg> ./vcpkg env --triplet x86-windows --debug
...
F:\vcpkg>where $include:io.h
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\io.h

PS F:\vcpkg> ./vcpkg install python3
The following packages will be built and installed:
python3[core]:x86-windows
Starting package 1/1: python3:x86-windows
Building package python3[core]:x86-windows...
-- Downloading https://github.com/python/cpython/archive/v3.7.3.tar.gz...
-- Extracting source F:/vcpkg/downloads/python-cpython-v3.7.3.tar.gz
-- Using source at F:/vcpkg/buildtrees/python3/src/v3.7.3-1161ad7a91
-- Building F:/vcpkg/buildtrees/python3/src/v3.7.3-1161ad7a91-Lib-dynamic-crt-dynamic/PCBuild/pythoncore.vcxproj for Release
-- Building F:/vcpkg/buildtrees/python3/src/v3.7.3-1161ad7a91-Lib-dynamic-crt-dynamic/PCBuild/pythoncore.vcxproj for Debug
-- Performing post-build validation
-- Performing post-build validation done
Building package python3[core]:x86-windows... done
Installing package python3[core]:x86-windows...
Installing package python3[core]:x86-windows... done
Elapsed time for package python3:x86-windows: 4.036 min

@PhoebeHui PhoebeHui added the requires:repro The issue is not currently repro-able label Jul 3, 2019
@singh0506
Copy link
Author

Thanks phoebeHui for your response, even i have vs2019 16.2.0 preview and SDK 18362 and latest vcpkg.
but still io.h not found error coming. can you please check attached log in earlier comment log name is build-x64-windows-rel-out.log ?

and while running where $include:io.h , got below console log:

c:\workspaceforvcpkg\vcpkg>where $include:io.h
INFO: Could not find files for the given pattern(s).

why running "where" command gives error, even if io.h file present in that location. Do i need to add environment variable as INCLUDE ? can you please suggest me what else need to be done ?

@PhoebeHui
Copy link
Contributor

PhoebeHui commented Jul 3, 2019

@singh0506, I have checked the attached logs, it failed due to 'error C1083: Cannot open include file: 'io.h': No such file or directory', it looks windows sdk has something wrong here.

Follow below steps and check if windows sdk related environment variable set correctly or what revision it does used here.

  1. Open windows powershell by admin
  2. Execute ./vcpkg env --triplet x86-windows --debug or ./vcpkg env --triplet x64-windows --debug
  3. Run 'set' command and check

UCRTVersion=10.0.18362.0
UniversalCRTSdkDir=C:\Program Files (x86)\Windows Kits\10
...
WindowsLibPath=C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.18362.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.18362.0
WindowsSdkBinPath=C:\Program Files (x86)\Windows Kits\10\bin
WindowsSdkDir=C:\Program Files (x86)\Windows Kits\10
WindowsSDKLibVersion=10.0.18362.0
WindowsSdkVerBinPath=C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0
WindowsSDKVersion=10.0.18362.0\

@singh0506
Copy link
Author

thanks phoebehui for your response.

after running set command, i am not able see above mentioned path correctly.

I am attaching set.txt file , can you verify if all environment variables are correct or what need to be corrected.
thank you so much for your quick reply.
set.txt.txt

@PhoebeHui
Copy link
Contributor

@singh0506, except missing windows sdk related environment variable, others looks fine, I recommend you to reinstall windows sdk 18362, please install it via VS installer, and check these variable again.

@singh0506
Copy link
Author

@PhoebeHui , i have uninstall 18362 and reinstall through vs installer. but still did not find sdk related environment variable. please find attach after.txt file for environment variable.

is there any way to set sdk related environment variable manually ?

after.txt

@PhoebeHui
Copy link
Contributor

PhoebeHui commented Jul 3, 2019

@singh0506 , how about
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v10.0 ?

image

And KitsRoot10 value under
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows Kits\Installed Roots
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots

They are all should be
image

From your log, the variable be set, looks, the kitsRoot10 seems empty
WindowsLibPath=References\CommonConfiguration\Neutral
WindowsSDKLibVersion=winv6.3
WindowsSDKVersion=\

@singh0506
Copy link
Author

I am not able to open regedit since it is disabled . If kitsRoot10 is empty. then in this case, what need to be done ?

@PhoebeHui
Copy link
Contributor

@singh0506, in this case, I won't recommend, but as a work around, you can try to 'set __VCVARSALL_WINSDK=10.0.18362.0' in "C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Auxiliary\Build\vcvarsall.bat", and run it with arg 'x86' or 'x64'

If it doesn't work, try to set the related variable in "C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\Common7\Tools\vsdevcmd\core\winsdk.bat"

@singh0506
Copy link
Author

thanks @PhoebeHui , for helping me out to find solution.
reason of not updating win sdk environment variable is registry edit was disabled.
once, I enable the regitry edit. then now it's working fine.

@PhoebeHui
Copy link
Contributor

Great to hear that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
requires:repro The issue is not currently repro-able
Projects
None yet
Development

No branches or pull requests

3 participants