# PythonAppResource.withUv

- Module: [Aspire.Hosting.Python](/reference/api/typescript/aspire.hosting.python.md)
- Defined on: [PythonAppResource](/reference/api/typescript/aspire.hosting.python/pythonappresource.md)
- Version: `13.4.0`
- Kind: `method`

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;
}
```

## Signature

```typescript
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`

## Defined on

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