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
vcpkg install error:in triplet x64-windows: Unable to find a valid Visual Studio instance Could not locate a complete Visual Studio instance #22074
Comments
Hi! I'm facing the same issue in a similar environment, trying to install any package. Some comments:
Please, should modify the triplet Please, should we install and configure CMake? Sorry, I'm a bit lost. Thanks for your help! |
Visua lStudio Installer->installed version->modify-> Language package->add English package, can resolve this problem |
Is this issue resolved? |
I am having a similar problem. "Could not locate a complete Visual Studio instance" although it is installed. I tried to use vcpkg to install catch2. English langauge package is already installed... Any other suggestions how to resolve this? I hope it is fine I write here, I think it is the same issue... |
I have the same problem, I use VS CODE to compile, but now there is a problem with installing the egin3 pakage. |
@KevinShu-AEUST Please see the required Visual Studio components in microsoft/vcpkg-tool#314. |
sorry,I don't understand the solution for this post. |
@KevinShu-AEUST Sorry, I don't quite understand your question! |
|
Please use Visual Studio Installer to install the following Visual Studio components:
|
Is there any solution to purely run vcpkg with the EWDK? Setting the ENV before running vcpkg doesn't work, but as far as I can tell the EWDK should have everything required to build the packages.
|
Установка английского языка помогла |
@S0PEX No, currently vcpkg needs Visual Studio core desktop features. |
Visual Studio is installed in C:\Program Files\Microsoft Visual Studio\2022 - I don't understand what is the problem? |
Can you please view my comment and have a try? Thanks. |
I found a solution for me installing the C++ visual studio toolchain onto my C drive worked though it doesn't work when I install Visual studio on my E drive. |
@nikinov Installing Visual Studio to a non-system disk doesn't affect vcpkg, maybe because of a problem with its environment variable settings. |
@HaifaBenHsouna See the required Visual Studio components in #22074 (comment). |
Not worked with me |
@AndroTwrpid Can you please provide the Visual Studio components list you installed and the failure output / logs? Thanks! |
The problem has not been fixed yet. Thats Crazy.
Inviato da Outlook per Android<https://aka.ms/AAb9ysg>
…________________________________
From: Jack·Boos·Yu ***@***.***>
Sent: Monday, February 13, 2023 2:50:06 AM
To: microsoft/vcpkg ***@***.***>
Cc: Paul Kotrik ***@***.***>; Mention ***@***.***>
Subject: Re: [microsoft/vcpkg] vcpkg install error:in triplet x64-windows: Unable to find a valid Visual Studio instance Could not locate a complete Visual Studio instance (Issue #22074)
To anyone who use VS installer which provided by VSCode: use the standard VS installer instead.
—
Reply to this email directly, view it on GitHub<#22074 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/APCPDKTDHAM2USUXSSRYJWDWXGHM5ANCNFSM5KKK5O6Q>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
It is embarrassing! |
in my case pc reboot and remove custom paths resolve issue |
got fixed after downloading from within Visual Studio Installer Download at least both otherwise other build errors emerge! |
Vcpkg 2023-06-22-f19f3d9939100085fe2f7e41502d60b08e2083b6 Same error on build server. Installed are:
On the two build tools installation, a listed pre-requisites have been installed and independently verified to be present. Adding
Output below in details. The file vcvarsall.bat can be found in the file system on:
However,
Changed
None helped. Looked at calls made from process monitor of sysinternals. Executables included:
The following paths are checked it seems:
Strangely enough the other instances listed from vswhere.exe are excluded, solely the empty instance is studied which happens to include some VC components: ...
<instance>
<instanceId>VisualStudio.14.0</instanceId>
<installationPath>C:\Program Files (x86)\Microsoft Visual Studio 14.0\</installationPath>
<installationVersion>14.0</installationVersion>
</instance>
... This raises the suspicion that the VS lookup code solely investigates in depth the first hit. But that was established without checking the code of vspkg. Suggestion: It would be helpful when the error (at least with --debug) would include what alternatives were considered and skipped, and for the candidates studied what omission they were disqualified for use. An empty virtual machine was started and solely the build tools were installed from Visual Studio. Vcpkg could install protobuf without problems. As next step, the following components were uninstalled on the original device:
Using An investigation into the registry revealed that this instances seemed needed for instance for "AndroidPlatformTools,Xamarin", and countless others. We removed the individual component: "MSVC v140 - VS 2015 C++ build tools (v14.00)" from both build installations. The instance with
But vcpkg still did not study the locations of the build tools. As a next test, the Visual Studio Test Agent 2022 (2) (17.6.4) was uninstalled. The next run of
The test agent was no longer studied as expected, but it now also studied the folder of one of the build tools installations. This makes the suggestion stronger that solely one installation of Visual Studio is studied from some point on. As a next step the installation in After that, the output for the first time mentioned the folder with
As the next step, we have removed the system environment variable VCPKG_VISUAL_STUDIO_PATH from the environment, and started a new console. In that console, again This time everyting worked fine! It seems that the root cause for this specific instance of the error was that vcpkg solely studies the first installation seriously from some point on (for instance after establishing that the folder exists). In case the first studied installation of Visual Studio does not meet the requirements, all other installations of Visual Studio seem to be ignored (as also seen in Processmon.exe), although these might be a great fit. I think this can be considered a usability bug, but since the issue is already closed I will create a new one and link to this analysis. Report #32506 Details Data Uploaded to Mothership```json [ { "ver": 1, "name": "Microsoft.ApplicationInsights.Event", "time": "2023-07-11T10:08:23Z", "sampleRate": 100.000000, "seq": "0:0", "iKey": "b4e88960-4393-4dd9-ab8e-97e8fe6d7603", "flags": 0, "tags": { "ai.device.os": "Other", "ai.device.osVersion": "Windows-10.0.17763", "ai.session.id": "c9bb58f4-a530-4ae8-8c15-e8a9e45e230a", "ai.user.id": "a3856a31-f216-476e-9017-61098dec01fa", "ai.user.accountAcquisitionDate": "2023-06-23T12:06:23Z" }, "data": { "baseType": "EventData", "baseData": { "ver": 2, "name": "commandline_test7", "properties": { "user_mac": "73089f066086eae8cb41503f5a2b16ca5516b9a7c2fc4a2371c510b55a28ad8a", "command_name": "x-upload-metrics", "deployment_kind": "Git", "vcpkg_version": "2023-06-22-f19f3d9939100085fe2f7e41502d60b08e2083b6", "detected_container": false, "feature-flag-binarycaching": true, "feature-flag-compilertracking": true, "feature-flag-dependency-graph": false, "feature-flag-registries": true, "feature-flag-versions": true, "process_tree": "94c46998623631400868cd8cabc1da6a310cb1a550997cfd2d7fada90ff287bb" }, "measurements": { "elapsed_us": 261609.500000 } } } } ] ```Details VSWhere```xml 28639c72 2022-04-01T15:02:22Z VisualStudio/17.6.4+33815.320 C:\Program Files (x86)\Microsoft Visual Studio\2022\TestAgent 17.6.33815.320 Microsoft.VisualStudio.Product.TestAgent C:\Program Files (x86)\Microsoft Visual Studio\2022\TestAgent\Common7\IDE\TestAgentConfigUI.exe 4294967295 1 1 0 0 Visual Studio Test Agent 2022 Supports running automated tests and load tests remotely VisualStudio.17.Release https://aka.ms/vs/17/release/channel C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service VisualStudio.17.Release https://aka.ms/vs/17/release/channel https://docs.microsoft.com/en-us/visualstudio/releases/2022/release-notes-v17.6#17.6.4 https://go.microsoft.com/fwlink/?LinkId=661288 2023-06-23T12:10:54.0751878Z d17.6 17.6.33815.320 VisualStudio/17.6.4+33815.320 build-lab VisualStudio installer 17.6.4 Dev17 2022 RTW False Visual Studio 4 1.0 17.6.4+33815.320 3.6.2115.31769 05009690261 VisualStudio.17.Release/17.6.4+33815.320 2 C:\Program Files (x86)\Microsoft Visual Studio\Installer\setup.exe 5d9abce5 2022-10-12T14:02:14Z VisualStudio/17.6.4+33815.320 C:\Program Files (x86)\Microsoft Visual Studio\2022\Preview 17.6.33815.320 Microsoft.VisualStudio.Product.BuildTools C:\Program Files (x86)\Microsoft Visual Studio\2022\Preview\Common7\Tools\LaunchDevCmd.bat 4294967295 1 1 0 0 Visual Studio Build Tools 2022 The Visual Studio Build Tools allows you to build native and managed MSBuild-based applications without requiring the Visual Studio IDE. There are options to install the Visual C++ compilers and libraries, MFC, ATL, and C++/CLI support. VisualStudio.17.Release.LTSC.17.6 https://aka.ms/vs/17/release.LTSC.17.6/channel C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service VisualStudio.17.Release.LTSC.17.6 https://aka.ms/vs/17/release.LTSC.17.6/channel https://docs.microsoft.com/en-us/visualstudio/releases/2022/release-notes-v17.6#17.6.4 https://go.microsoft.com/fwlink/?LinkId=661288 2023-06-23T12:11:18.7938324Z d17.6 17.6.33815.320 VisualStudio/17.6.4+33815.320 build-lab VisualStudio installer 17.6.4 Dev17 2022 RTW False Visual Studio 4 1.0 17.6.4+33815.320 3.6.2115.31769 36835 VisualStudio.17.Release.LTSC.17.6/17.6.4+33815.320 C:\Program Files (x86)\Microsoft Visual Studio\Installer\setup.exe a0993df1 2022-03-13T14:11:23Z VisualStudio/17.6.4+33815.320 C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools 17.6.33815.320 Microsoft.VisualStudio.Product.BuildTools C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\LaunchDevCmd.bat 4294967295 1 1 0 0 Visual Studio Build Tools 2022 The Visual Studio Build Tools allows you to build native and managed MSBuild-based applications without requiring the Visual Studio IDE. There are options to install the Visual C++ compilers and libraries, MFC, ATL, and C++/CLI support. VisualStudio.17.Release https://aka.ms/vs/17/release/channel C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service VisualStudio.17.Release https://aka.ms/vs/17/release/channel https://docs.microsoft.com/en-us/visualstudio/releases/2022/release-notes-v17.6#17.6.4 https://go.microsoft.com/fwlink/?LinkId=661288 2023-06-23T12:13:14.2678107Z d17.6 17.6.33815.320 VisualStudio/17.6.4+33815.320 build-lab VisualStudio installer 17.6.4 Dev17 2022 RTW False Visual Studio 4 1.0 17.6.4+33815.320 3.6.2115.31769 VisualStudio.17.Release/17.6.4+33815.320 C:\Program Files (x86)\Microsoft Visual Studio\Installer\setup.exe VisualStudio.14.0 C:\Program Files (x86)\Microsoft Visual Studio 14.0\ 14.0 ``` |
@Cheney-W Personally I think this issue should be left open until we get it right. |
I'm facing pretty much similar issue and it's blocking me to build OnnxRuntime inside docker container and getting following error.
ARG BASE_IMAGE=mcr.microsoft.com/windows:10.0.19042.1889
FROM ${BASE_IMAGE}
SHELL ["cmd", "/S", "/C"]
RUN mkdir c:\tmp
WORKDIR /tmp
RUN powershell.exe Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine
RUN powershell.exe [Net.ServicePointManager]::Expect100Continue=$true;[Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls,[Net.SecurityProtocolType]::Tls11,[Net.SecurityProtocolType]::Tls12,[Net.SecurityProtocolType]::Ssl3;Invoke-Expression( New-Object System.Net.WebClient ).DownloadString('https://chocolatey.org/install.ps1')
RUN choco install git docker unzip -y
# Be aware that pip can interact badly with VS cmd shell so need to pip install before
# vsdevcmd.bat (see https://bugs.python.org/issue38989)
ARG PYTHON_VERSION=3.8.10
ARG PYTHON_SOURCE=https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-amd64.exe
ADD ${PYTHON_SOURCE} python-${PYTHON_VERSION}-amd64.exe
RUN python-%PYTHON_VERSION%-amd64.exe /quiet InstallAllUsers=1 PrependPath=1 Include_doc=0 TargetDir="C:\python%PYTHON_VERSION%"
RUN mklink "C:\python%PYTHON_VERSION%\python3.exe" "C:\python%PYTHON_VERSION%\python.exe"
RUN pip install --upgrade wheel setuptools docker
RUN pip install grpcio-tools
LABEL PYTHON_VERSION=${PYTHON_VERSION}
# Currently this is 17.0.23. This page contains download links for buildtools.
# https://learn.microsoft.com/en-us/visualstudio/releases/2022/release-history#release-dates-and-build-numbers
ARG BUILDTOOLS_VERSION=17.0.23
ARG BUILDTOOLS_SOURCE=https://download.visualstudio.microsoft.com/download/pr/60029857-49a0-4e99-94d0-5a0a9b1f98e6/cc95bfc8b8ca80dc5b256989f55cb5a6fdf76d97975af2d121dda770a0a17697/vs_BuildTools.exe
ARG VS_INSTALL_PATH_WP="C:\BuildTools"
RUN powershell.exe Start-Process -FilePath vs_buildtools.exe -ArgumentList "--wait","--quiet","--norestart","--nocache","--installPath","%VS_INSTALL_PATH_WP%","--channelUri","C:\tmp\doesnotexist.chman","--addProductLang","En-us","--add","Microsoft.VisualStudio.Workload.VCTools`;includeRecommended","--add","Microsoft.Component.MSBuild" -Wait -PassThru
LABEL BUILDTOOLS_VERSION=${BUILDTOOLS_VERSION}
WORKDIR /
#
# Installing Vcpkg
#
ARG VCPGK_VERSION=2023.07.21
RUN git clone --single-branch --depth=1 -b %VCPGK_VERSION% https://github.com/microsoft/vcpkg.git
WORKDIR /vcpkg
RUN bootstrap-vcpkg.bat
RUN vcpkg.exe update
RUN vcpkg.exe install openssl:x64-windows openssl-windows:x64-windows rapidjson:x64-windows re2:x64-windows boost-interprocess:x64-windows boost-stacktrace:x64-windows zlib:x64-windows pthread:x64-windows b64:x64-windows
RUN vcpkg.exe integrate install error statement:
|
In my scenario issue with .\vs_buildtools.exe --quiet --wait --norestart --nocache install `
--installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" `
--channelUri C:\TEMP\VisualStudio.chman `
--installChannelUri C:\TEMP\VisualStudio.chman `
--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 `
--add Microsoft.Component.MSBuild |
You can download the required dependencies via winget (note that this is for vs2022 with the Windows 11 SDK, refer to: vs2022 or vs2019) For example: winget install Microsoft.VisualStudio.2022.BuildTools --force --override "--wait --passive --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows11SDK.22621 --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core --add Microsoft.Component.MSBuild --add Microsoft.VisualStudio.Component.Windows10SDK --add Microsoft.VisualStudio.Component.VC.Tools.arm --add Microsoft.VisualStudio.Component.VC.Tools.arm64 --add Microsoft.VisualStudio.ComponentGroup.UWP.VC" |
I was having the problem but it wasn't caused by missing tooling but rather my anti-virus (Malwarebytes in this case) had decided that some of the internal visual studio tools were suspicious and silently purged them. It deleted the following: I assume it was the latter one that caused this tool to break. It stands to reason that any program that prevents its usage will cause this error to appear. It might be apt to check for the execution of this executable is successful and if its not return a more clear error. |
I noticed that I had installed two VS after a whole day long debug. |
Can someone suggest a solution that uses existing MinGW compilers? How do Iink my compiler to vcpkg? |
@deepwilson Not in this issue. |
@dg0yt I am currently getting the same error as posted in the title " |
@deepwilson There are answers for mingw. But not in this issue. |
I have the same problem. The reason is that visual studio is not installed in the default path, which will also cause vcpkg to not be able to find visual studio. I reinstalled visual studio to the default path of the C drive and the problem was solved. |
Thanks @Lazrius. Malwarebytes silently killed CMake on my machine too. Other parts of Visual Studio worked - I just couldn't build a simple "Hello world!" plugin (which was the reason why I installed Visual Studio in the first place). |
This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 28 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment. |
keep alive. |
Hi, |
For me I had cloned the repo and installed |
Describe the bug
A clear and concise description of what the bug is.
When using vcpkg install, an error occurred: in triplet x64-windows: Unable to find a valid Visual Studio instance
Could not locate a complete Visual Studio instance
Environment
To Reproduce
Steps to reproduce the behavior:
Error: in triplet x86-windows: Unable to find a valid Visual Studio instance
Could not locate a complete Visual Studio instance
The text was updated successfully, but these errors were encountered: