> ## 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.

# CREATE FUNCTION ENVIRONMENT

<a id="sql-create-function-environment" />

Creates a new [function environment](/content/udf/python/writing#udf-python-func-env) for
[UDFs/UDTFs](/content/sql/udf#sql-udf) written using the Python UDF API, where any
packages required by the Python UDF can be installed and used.  Packages can be
installed with the [ALTER FUNCTION ENVIRONMENT](/content/sql/udf/alter-function-environment#sql-alter-function-environment) command.

```sql title="CREATE FUNCTION ENVIRONMENT Syntax" theme={null}
CREATE [OR REPLACE] FUNCTION ENVIRONMENT <environment name>
```

<Info>
  UDFs running with no function environment specified run in the
  default function environment, `kinetica-default-environment`.  See
  [Pre-installed Libraries on the Cluster](/content/udf/python/writing#udf-python-libs) for the list of pre-installed Python packages.
</Info>

## Parameters

<AccordionGroup>
  <Accordion title="OR REPLACE" id="or-replace" defaultOpen>
    Any existing UDF environment with the same name will be dropped before creating this one
  </Accordion>

  <Accordion title="<environment name>" id="<environment-name>" defaultOpen>
    Name of the UDF environment, which can be referenced in subsequent commands
  </Accordion>
</AccordionGroup>

## Examples

To create the Python UDF environment `udfe_st`:

```sql CREATE FUNCTION ENVIRONMENT Example theme={null}
CREATE FUNCTION ENVIRONMENT udfe_st
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.