---
title: "Installing or upgrading to v2 Python SDKs"
slug: "installing-or-upgrading-to-the-v2-python-sdk"
updated: 2026-04-15T11:49:01Z
published: 2026-04-15T11:49:01Z
canonical: "support.lusid.com/installing-or-upgrading-to-the-v2-python-sdk"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://support.lusid.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Installing or upgrading to v2 Python SDKs

> [!WARNING]
> **Important**: This is not the [latest version](/v1/docs/installing-or-upgrading-to-the-v3-python-sdk). v2 SDKs are supported for now, but will be discontinued later in 2026.

You can install or upgrade to v2 of the following packages in Python 3.11+ environments:

- LUSID Python SDK
- Other Python SDKs in the [FINBOURNE platform](/v1/docs/understanding-all-the-applications-in-the-finbourne-platform), for example Drive, Scheduler and Luminesce.

Note if you are upgrading then all SDKs used in a process must use the same major version. For example, a process that uses both the Scheduler and Drive SDKs must either use v1 of both SDKs *or* v2 of both SDKs; mixing major versions leads to dependency conflicts.

## Installing v2 LUSID Python SDK

You can install v2 of the LUSID Python SDK from [PyPi](https://pypi.org/project/lusid-sdk/) using your preferred package manager, for example:

```shell
pip install lusid-sdk
pip install "finbourne-sdk-utils<1"   # Optional useful utilities
```

Note the following:

- Python 3.11 or later is required.
- We strongly recommend pinning a SDK to an exact version to control when you take updates and make your builds repeatable.
- Alternatively, you can download the source by [cloning the Github repo](https://github.com/finbourne/lusid-sdk-python). If you do, note the `main` branch may not always correspond to the latest REST API version.
- If you install `finbourne-sdk-utils`, the version number of this package *must* be less than `1.0.0`.

### Preview SDKs

This release discontinues publishing the LUSID Preview SDK, instead adding the Experimental and Beta lifecycle APIs to the LUSID SDK. Note that making requests to Experimental and Beta APIs requires additional licences; for more details please [contact support](https://www.finbourne.com/contact).

### **Changes to extensions packages**

v1 `lusid.utilities` package has been renamed as `lusid.extensions`. The package now supports asynchronous requests using the [asyncio](https://docs.python.org/3/library/asyncio.html) library and makes loading configuration more configurable and readable:

- You can now build an asynchronous client using the `ApiClientFactory`. To close connections after use, we recommend making requests within a context using a `with` statement.

```python
from lusid import ApiClientFactory, ApplicationMetadataApi
api_client_factory = ApiClientFactory()
async with api_client_factory:
    api_instance = api_client_factory.build(ApplicationMetadataApi)
```
- You can now pass in a list of configuration loaders to `ApiClientFactory` or `SyncApiClientFactory`. We currently provide loaders for reading API configuration from environment variables, a secrets file or keyword arguments. [Read more on authenticating to LUSID with the LUSID SDK.](/v1/docs/how-do-i-use-an-api-access-token-with-the-lusid-sdk) For example:

```python
from lusidjam import RefreshingToken
from lusid import (
    SyncApiClientFactory,
    ApplicationMetadataApi,
    EnvironmentVariablesConfigurationLoader,
    SecretsFileConfigurationLoader,
    ArgsConfigurationLoader
)
config_loaders = [
    EnvironmentVariablesConfigurationLoader(),
    SecretsFileConfigurationLoader(secrets_path="secrets.json"),
    ArgsConfigurationLoader(access_token = RefreshingToken(), app_name = "LusidPython")
]
api_client_factory = SyncApiClientFactory(config_loaders=config_loaders)
api_instance = api_factory.build(ApplicationMetadataApi)
```

Note the following:
  - Configuration loaders each return a dictionary of configuration keys and values. When keys are found by multiple configuration loaders, the last configuration loader to read the key overrides previous loaders.
  - Custom configuration loaders must implement the `load_config` method described in the configuration loader protocol.

### Model arguments must be named

v2 of the LUSID Python SDK uses [Pydantic](https://docs.pydantic.dev/1.10/) to perform runtime type checking on model objects. The v2 upgrade removes positional argument support; model arguments must now be explicitly named.

For example:

```python
## v1 of the SDK...
python_version = 'some_version' 
api_response = api_instance.get_excel_addin(python_version)

## ...might change as follows for v2 of the SDK to make the key/value pairs explicit:
python_version = 'some_version' 
api_response = await api_instance.get_excel_addin(version=python_version)
```

### Function arguments are type checked

In v2, models are more strict with argument types, and calling a function with incorrect types now throws a validation error. The error message shows you which fields need their values updating to meet the type check requirements.

For example:

```python
 2 validation errors for Model 
 is_required 
     Field required [type=missing, input_value={'list_of_ints': ['1', 2,...ew York'}, 'gt_int': 21}, input_type=dict] 
 gt_int 
     Input should be greater than 42 [type=greater_than, input_value=21, input_type=int]
```

### Hello world

This example authenticates to the synchronous version of the SDK using a secrets file and invokes the [ListInstruments](https://www.lusid.com/docs/api/lusid/endpoints/instruments/ListInstruments) API:

```python
# Setup:
import lusid, pprint
from lusidjam import RefreshingToken
from lusid.extensions import (
    SyncApiClientFactory,
    ArgsConfigurationLoader,
    SecretsFileConfigurationLoader
)
# Assemble config:
secrets_path = "/path/to/secrets.json"
config_loaders=[
    ArgsConfigurationLoader(access_token = RefreshingToken(), app_name = "LusidJupyterNotebook"),
    SecretsFileConfigurationLoader(secrets_path) 
]
# Instantiate and authenticate:
api_factory = SyncApiClientFactory(config_loaders=config_loaders)
# Build Instruments API and list first instrument:
try:
    instruments_api = api_factory.build(lusid.InstrumentsApi)
    response = instruments_api.list_instruments(limit=1)
    pprint.pprint(response.to_dict()["values"])
except lusid.exceptions.ApiException as e:
    print(e)
```

## FINBOURNE SDK Utils replaces LUSID Python Tools

LUSID Python Tools is only available for use with v1 of the LUSID Python SDK. For v2 SDKs, [FINBOURNE SDK Utils](https://github.com/finbourne/finbourne-sdk-utils/tree/main) is introduced as a replacement for LUSID Python Tools.

FINBOURNE SDK Utils contains a set of utility functions for interacting with the v2 LUSID Python SDKs. The package includes all of the capabilities of LUSID Python Tools, in addition to the changes and improvements listed [here](https://github.com/finbourne/finbourne-sdk-utils/tree/main?tab=readme-ov-file#differences-between-this-version-and-the-previous-sdk). ***Users may need to update their code to reflect the changes.***

You can install FINBOURNE SDK Utils for the LUSID Python SDK using the following `pip` command. Note the package version number must be less that 1.0.0:

```shell
pip install "finbourne-sdk-utils<1"
```

## Installing v1 LUSID Python SDK

Please note v1 of the LUSID Python SDK is now discontinued, but if you *do* need to install it for any reason then two packages are published:

- `lusid-sdk` contains only APIs with a [lifecycle status](/v1/docs/what-is-the-lusid-feature-release-lifecycle) of Production or Early Access. You can install it using the following pip command:

```shell
pip install lusid-sdk<2
```
- `lusid-sdk-preview` contains additional APIs with a lifecycle status of Experimental or Beta. You can install it using the following pip command:

```shell
pip install lusid-sdk-preview<2
```
