How to use the dotnetcore2.runtime.ensure_dependencies function in dotnetcore2

To help you get started, we’ve selected a few dotnetcore2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / NimbusML / src / python / nimbusml / internal / utils / utils.py View on Github external
def set_clr_environment_vars():
    """
    Set system environment variables required by the .NET CLR.
    Python 3.x only, as dotnetcore2 is not available for Python 2.x.
    """
    if six.PY2:
        pass
    else:
        from dotnetcore2 import runtime as clr_runtime
        dependencies_path = None
        try: 
            # try to resolve dependencies, specifically libunwind for Linux
            dependencies_path = clr_runtime.ensure_dependencies()
        except:
            pass
        # Without this, Linux versions would require the ICU package
        os.environ['DOTNET_SYSTEM_GLOBALIZATION_INVARIANT'] = 'true'
        # Will be None for Windows
        if dependencies_path is not None:
            os.environ['LD_LIBRARY_PATH'] = dependencies_path

dotnetcore2

.Net Core 3.1 runtime

MIT
Latest version published 3 years ago

Package Health Score

79 / 100
Full package analysis

Similar packages