Skip to main content

Python vswhere

This module provides an interface to Microsoft's Visual Studio locator too, 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.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-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

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

Uploaded Python 2

File details

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

File metadata

  • Download URL: vswhere-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.tar.gz
Algorithm Hash digest
SHA256 d0c21f493ea50f653181148ec652766fdd4e6d6b5c56423599a2a6f54ddbd96a
MD5 9ea53d81292492188d175c33743c9a6f
BLAKE2b-256 6b60de1b358a303120c8d42b5b7a0f76c89746b658197df0217cbe07307d6274

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vswhere-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-py3-none-any.whl
Algorithm Hash digest
SHA256 021fff036492fada2fa72aab82783b4ac6bc37ea23d00b01302279d70b7a60d9
MD5 fd9b1529507a7f1e91bd80d3069b2329
BLAKE2b-256 a8adb9db185cb7245d6b808b741bee5c6b6520449efff303d3d5f6029fc314fa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vswhere-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-py2-none-any.whl
Algorithm Hash digest
SHA256 8d0efcf37e69adc24d9f777999d5591ac0d239a2ddef6187dc652725f73f04f8
MD5 0fc1e77013c8a87bc8e4261299444c2f
BLAKE2b-256 f2e07d1c998f22f915d0f50314924e75fc6a2658dfbb325be701ac1b1dd82efd

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 Sentry Error logging StatusPage Status page