/// <summary>
 /// Creates a provider for managing packages through pip.
 /// </summary>
 /// <param name="factory">The associated interpreter.</param>
 /// <param name="index">
 /// The index URL. Defaults to https://pypi.python.org/pypi/
 /// </param>
 /// <param name="indexName">
 /// Display name of the index. Defaults to PyPI.
 /// </param>
 public PipExtensionProvider(
     IPythonInterpreterFactory factory,
     string index     = null,
     string indexName = null
     )
 {
     _factory = factory;
     _output  = new PipRedirector(this);
     if (!string.IsNullOrEmpty(index) && Uri.TryCreate(index, UriKind.Absolute, out _index))
     {
         _indexName = string.IsNullOrEmpty(indexName) ? _index.Host : indexName;
     }
     _cache = PipPackageCache.GetCache(_index, _indexName);
 }
        /// <summary>
        /// Creates a provider for managing packages through pip.
        /// </summary>
        /// <param name="factory">The associated interpreter.</param>
        /// <param name="index">
        /// The index URL. Defaults to https://pypi.python.org/pypi/
        /// </param>
        /// <param name="indexName">
        /// Display name of the index. Defaults to PyPI.
        /// </param>
        public PipExtensionProvider(
            IPythonInterpreterFactory factory,
            string index     = null,
            string indexName = null
            )
        {
            _factory        = factory;
            _packageManager = _factory.PackageManager;
            if (_packageManager == null)
            {
                throw new NotSupportedException();
            }

            if (!string.IsNullOrEmpty(index) && Uri.TryCreate(index, UriKind.Absolute, out _index))
            {
                _indexName = string.IsNullOrEmpty(indexName) ? _index.Host : indexName;
            }
            _cache = PipPackageCache.GetCache(_index, _indexName);
        }