SDK 14.9.0: ValueError for API calls using Python 3.10.8 (solved)

I was about to report a bug, but found out that upgrading my Python 3.10.8 to 3.10.11 solved this issue. Maybe usefull to someone else

Which tool versions are you using?

SDK: v14.9.0
Platform: v24.04.3
Python: v3.10.8
Isolation mode: venv

Current Behavior

After updating an app from SDK 14.8.0 to 14.9.0, I get a ValueError for every API call we make. When I use this code from the docs:

api = API()
current_entity = api.get_entity(entity_id)

This ValueError is thrown

2024-04-12 22:01:25.479 ERROR   : 
Traceback (most recent call last):
  File "viktor\parametrization.pyx", line 2343, in viktor.parametrization._SelectField._handle_options_constraint
  File "%%%\app\design\parametrization.py", line 143, in _get_cross_section_design_names
    current_entity = api.get_entity(entity_id)
  File "viktor\api_v1.pyx", line 1102, in viktor.api_v1._API.get_entity
ValueError: `workspace_id` is required if API is initiated outside of a VIKTOR app.

Somehow the API doesn’t recognize this as a call from inside the app.

Expected Behavior

Expected the existing code to be compatible.

Context (optional, but preferred)

:white_check_mark: Was able to fix the behavior by upgrading Python to 3.10.11.

If you used Python from the Microsoft Store, update the patch version with the PowerShell command winget install python.python.3.10 and rebuild you venv.

Hi @rkg

The viktor-connector that is required for the workspaces API was not released at the exact same moment as the release of SDK v14.9.0 causing the issue you described.

We updated this as soon as we realized this was the case, and I think you upgraded your Python at the same time but it should be unrelated!