# withUv

- Module: [Aspire.Hosting.Python](/reference/api/typescript/aspire.hosting.python.md)
- Version: `13.4.0`
- Kind: `method`
- Source: [GitHub](https://github.com/microsoft/aspire)

Adds a UV environment setup task to ensure the virtual environment exists before running the Python application.

## Definition

```typescript
interface PythonAppResource {
  // ... omitted for brevity
  withUv(
    install?: boolean,
    args?: string[]): PythonAppResource
}
```

## Parameters

- `install` (`boolean`) `optional` `= True`
- `args` (`string[]`) `optional`

## Returns

[PythonAppResource](/reference/api/typescript/aspire.hosting.python/pythonappresource.md) `builder`

## Applies to

- [PythonAppResource](/reference/api/typescript/aspire.hosting.python/pythonappresource.md)
- [UvicornAppResource](/reference/api/typescript/aspire.hosting.python/uvicornappresource.md)
