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

Creates a new [function environment](https://docs.kinetica.com/content/udf/python/writing.md#udf-python-func-env) for
[UDFs/UDTFs](https://docs.kinetica.com/content/sql/udf.md#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](https://docs.kinetica.com/content/sql/udf/alter-function-environment.md#sql-alter-function-environment) command.

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

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

## Parameters

> [accordion] OR REPLACE
>
> Any existing UDF environment with the same name will be dropped before creating this one

> [accordion] \<environment name>
>
> Name of the UDF environment, which can be referenced in subsequent commands

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