Skip to main content

Python vswhere

This module provides an interface to Microsoft's Visual Studio locator tool, vswhere.

If Visual Studio 15.2 or later has been installed, this will use the vswhere binary installed with Visual Studio. Otherwise, it will download the latest release of vswhere the first time a function is called.

Usage

find and find_first are the most generic functions. They support most of the command line options to vswhere. find returns a list of installed copies of Visual Studio matching the given options, and find_first returns only the first result.

If you are only interested in the latest version of Visual Studio, use get_latest. To get just the installation path, use get_latest_path. To get just the version number, use get_latest_version or get_latest_major_version.

If you want to use your own version of vswhere.exe instead of the one installed with Visual Studio, use set_vswhere_path to provide its location.

If you want to use a mirror instead of GitHub to download vswhere.exe, for example when on an intranet that does not have access to GitHub, use set_download_mirror and provide the URL of the mirror.

Examples

>>> import pprint, vswhere
>>> vswhere.get_latest_path()
'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community'
>>> vswhere.get_latest_version()
'15.8.28010.2003'
>>> vswhere.get_latest_major_version()
15
>>> vswhere.find(legacy=True, prop='installationPath')
['C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community', 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\']
>>> pp = pprint.PrettyPrinter(indent=4, width=200)
>>> pp.pprint(vswhere.find(legacy=True))
[   {   ...
        'description': 'Free, fully-featured IDE for students, open-source and individual developers',
        'displayName': 'Visual Studio Community 2017',
        'enginePath': 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\resources\\app\\ServiceHub\\Services\\Microsoft.VisualStudio.Setup.Service',
        'installDate': '2018-04-26T04:49:29Z',
        'installationName': 'VisualStudio/15.8.1+28010.2003',
        'installationPath': 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community',
        'installationVersion': '15.8.28010.2003',
        'instanceId': 'ee7ea828',
        'isPrerelease': False,
        'productId': 'Microsoft.VisualStudio.Product.Community',
        'productPath': 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\Common7\\IDE\\devenv.exe',
        'properties': ...,
        'releaseNotes': 'https://go.microsoft.com/fwlink/?LinkId=660692#15.8.1',
        'thirdPartyNotices': 'https://go.microsoft.com/fwlink/?LinkId=660708',
        'updateDate': '2018-08-19T20:49:30.0058548Z'},
    {'installationPath': 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\', 'installationVersion': '14.0', 'instanceId': 'VisualStudio.14.0'}]

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vswhere-1.2.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vswhere-1.2.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file vswhere-1.2.0.tar.gz.

File metadata

  • Download URL: vswhere-1.2.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.1

File hashes

Hashes for vswhere-1.2.0.tar.gz
Algorithm Hash digest
SHA256 175c40a2a739578f409d7f1a5979999a827ac10061f1f6d32337238b3831adc6
MD5 405ca732626e55b4856d28ee038eb402
BLAKE2b-256 8ea5f9da0007f530e9fc9b5b5914a77618230a83a3c4f9fa5a72b96761f3d186

See more details on using hashes here.

File details

Details for the file vswhere-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: vswhere-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.1

File hashes

Hashes for vswhere-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a189bb5904bf52dd32ec833748594c51adacc93d163796e6441956703d78bb8a
MD5 2714070fc6c53fe5cc8bb3e478522b6f
BLAKE2b-256 9275eb195c3301994fbd0fc4224451d4e11c32cf2e289da1586aec6cec4ccff5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page