> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# alter_environment

<div className="kinetica-pydoc">
  <div className="dl py method">
    <div className="dt sig sig-object py" id="gpudb.GPUdb.alter_environment"> <span className="sig-name descname"><span className="pre">alter\_environment</span></span><span className="sig-paren">(</span><span className="em sig-param"><span className="n"><span className="pre">environment\_name</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">None</span></span></span>, <span className="em sig-param"><span className="n"><span className="pre">action</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">None</span></span></span>, <span className="em sig-param"><span className="n"><span className="pre">value</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">None</span></span></span>, <span className="em sig-param"><span className="n"><span className="pre">options</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">{"{"}{"}"}</span></span></span><span className="sig-paren">)</span><a href="https://github.com/kineticadb/kinetica-api-python/blob/master/gpudb/gpudb.py#L19300"><span className="viewcode-link"><span className="pre">\[source]</span></span></a></div>

    <div className="dd">
      <p>Alters an existing environment which can be referenced by a <a className="reference external" href="/content/concepts/udf/">user-defined function</a> (UDF).</p>
      <p><strong>Parameters</strong></p>

      <div className="blockquote">
        <div>
          <div className="dl">
            <div className="dt">environment\_name (<span className="em">str</span>) –</div>

            <div className="dd">
              <p>Name of the environment to be altered.</p>
            </div>

            <div className="dt">action (<span className="em">str</span>) –</div>

            <div className="dd">
              <p>Modification operation to be applied. Allowed values are:</p>

              <ul className="simple">
                <li>
                  <p><strong>install\_package</strong> – Install a python package from PyPI, an external data source or KiFS.</p>
                </li>

                <li>
                  <p><strong>install\_requirements</strong> – Install packages from a requirements file.</p>
                </li>

                <li>
                  <p><strong>uninstall\_package</strong> – Uninstall a python package.</p>
                </li>

                <li>
                  <p><strong>uninstall\_requirements</strong> – Uninstall packages from a requirements file.</p>
                </li>

                <li>
                  <p><strong>reset</strong> – Uninstalls all packages in the environment and resets it to the original state at time of creation.</p>
                </li>

                <li>
                  <p><strong>rebuild</strong> – Recreates the environment and re-installs all packages, upgrades the packages if necessary based on dependencies.</p>
                </li>
              </ul>
            </div>

            <div className="dt">value (<span className="em">str</span>) –</div>

            <div className="dd">
              <p>The value of the modification, depending on input parameter <span className="em">action</span>. For example, if input parameter <span className="em">action</span> is <span className="em">install\_package</span>, this would be the python package name.</p>
              <p>If input parameter <span className="em">action</span> is <span className="em">install\_requirements</span>, this would be the path of a requirements file from which to install packages.</p>
              <p>If an external data source is specified in <span className="em">datasource\_name</span>, this can be the path to a wheel file or source archive. Alternatively, if installing from a file (wheel or source archive), the value may be a reference to a file in <a className="reference external" href="/content/tools/kifs/">KiFS</a>.</p>
            </div>

            <div className="dt">options (<span className="em">dict of str to str</span>) –</div>

            <div className="dd">
              <p>Optional parameters. Allowed keys are:</p>

              <ul className="simple">
                <li>
                  <p><strong>datasource\_name</strong> – Name of an existing external data source from which packages specified in input parameter <span className="em">value</span> can be loaded.</p>
                </li>
              </ul>

              <p>The default value is an empty dict ( {"{"}{"}"} ).</p>
            </div>
          </div>
        </div>
      </div>

      <p><strong>Returns</strong></p>

      <div className="blockquote">
        <div>
          <p>A dict with the following entries–</p>

          <div className="dl simple">
            <div className="dt">environment\_name (<span className="em">str</span>) –</div>

            <div className="dd">
              <p>Value of input parameter <span className="em">environment\_name</span>.</p>
            </div>

            <div className="dt">info (<span className="em">dict of str to str</span>) –</div>

            <div className="dd">
              <p>Additional information.</p>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
