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.1.1.tar.gz (4.6 kB view details)

Uploaded Source

Built Distributions

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

vswhere-1.1.1-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

vswhere-1.1.1-py2-none-any.whl (4.9 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: vswhere-1.1.1.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.3.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for vswhere-1.1.1.tar.gz
Algorithm Hash digest
SHA256 f711e3889467510fe6d0eaba340e1fc2473501a1c2fe4fcfb14d920b121d9243
MD5 9afe349498edca557e2493c345dd80fc
BLAKE2b-256 93e7e9a22251ecd3adbe149fff3f6a98801338c837d83f3f6072d330ccf50e5c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vswhere-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.3.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for vswhere-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 16097432b955fe31145eed3e034bb577d95f6b76c268e8d049771f476dcce2ba
MD5 ac303e6a9804b1b549a2efa06d9da5e2
BLAKE2b-256 b63e4fe136e20ee6ca746b65e35b1fafce109328e379e164102c67d2c068e614

See more details on using hashes here.

File details

Details for the file vswhere-1.1.1-py2-none-any.whl.

File metadata

  • Download URL: vswhere-1.1.1-py2-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.3.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for vswhere-1.1.1-py2-none-any.whl
Algorithm Hash digest
SHA256 de66486cb4980d8d60a6a4f6145279bae0f5d7c4aff7416993b618bedcefde52
MD5 b3222cbc345302111d9e9ab585f6eeaf
BLAKE2b-256 638c8ef17e1a8dd24a75a35135ff0f5649de11efa34b650380ca96299e92b907

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