PythonAppResource.withVirtualEnvironment

Method
📦 Aspire.Hosting.Python v17.0.0
interface PythonAppResource {
// ... omitted for brevity
withVirtualEnvironment(
virtualEnvironmentPath: string,
createIfNotExists?: boolean): PythonAppResource;
}

Signature

methodwithVirtualEnvironmentbuilder
Configures a custom virtual environment path for the Python application.
withVirtualEnvironment(
virtualEnvironmentPath: string,
createIfNotExists?: boolean): PythonAppResource
virtualEnvironmentPathstringThe path to the virtual environment. Can be absolute or relative to the app directory. When relative, it is resolved from the working directory of the Python application. Common values include ".venv", "venv", or "myenv".
createIfNotExistsbooleanoptional= TrueWhether to automatically create the virtual environment if it doesn't exist. Defaults to `true`. Set to `false` to disable automatic venv creation (the venv must already exist).
PythonAppResource

Defined on

This method is defined on the following type: