Skip to content

FAQ/Troubleshooting

How do we switch between versions of Python?

  • You should almost never need to install another version of Python. During development, we often use Python 3.11.9. However, we typically run our test suite on 3.10, 3.11, 3.12 and 3.13 to ensure compatibility. If you need to switch, then it best to contact a supervisor.

  • If you get approval, then there is an issue to watch out for, while using the dev_tool. The dev_tool uses uv as its default package manager to install dependencies. As such, uv will cache these dependencies to improve download/install speed. However, switching to a different Python version (e.g., Python 3.12.0) will result in an error, due to the uv cache and version incompatibilities.

Error:

The following occurs during the migration step of "(Re)build the development environment":

File "C:\Users\Username\project\.venv_win\Lib\site-packages\django\core\management\commands\migrate.py", line 101, in handle
    self.check(databases=[database])
File "C:\Users\Username\project\.venv_win\Lib\site-packages\django\core\management\base.py", line 486, in check
    all_issues = checks.run_checks(
File "C:\Users\Username\project\.venv_win\Lib\site-packages\django\core\checks\registry.py", line 88, in run_checks
    errors = check(app_configs=app_configs, databases=databases)
File "C:\Users\Username\project\.venv_win\Lib\site-packages\django\core\checks\translation.py", line 62, in check_language_settings_consistent
    get_supported_language_variant(settings.LANGUAGE_CODE)
File "C:\Users\Username\project\.venv_win\Lib\site-packages\django\utils\translation\__init__.py", line 256, in get_supported_language_variant
    return _trans.get_supported_language_variant(lang_code, strict)
File "C:\Users\Username\project\.venv_win\Lib\site-packages\django\utils\translation\trans_real.py", line 535, in get_supported_language_variant
    if code.lower() in supported_lang_codes and check_for_language(code):
File "C:\Users\Username\project\.venv_win\Lib\site-packages\django\utils\translation\trans_real.py", line 476, in check_for_language
    if lang_code is None or not search(lang_code):

NameError: name 'search' is not defined
[2025-05-01 10:54:14 AM] [ERROR] dev_tool.services.django: Error in run_django_management_command
Traceback (most recent call last):
    File "dev_tool\decorators.py", line 30, in wrapper
    File "dev_tool\services\django.py", line 192, in run_django_management_command
    File "subprocess.py", line 571, in run
subprocess.CalledProcessError: Command '[WindowsPath('C:/Users/Username/project/.venv_win/Scripts/python.exe'), WindowsPath('C:/Users/Username/project/manage.py'), 'migrate']' returned non-zero exit status 1.

[2025-05-01 10:54:14 AM] [ERROR] dev_tool.services.django: Error in run_django_migrate
Traceback (most recent call last):
    File "dev_tool\decorators.py", line 30, in wrapper
    File "dev_tool\services\django.py", line 226, in run_django_migrate
    File "dev_tool\decorators.py", line 63, in wrapper
    File "dev_tool\decorators.py", line 30, in wrapper
    File "dev_tool\services\django.py", line 192, in run_django_management_command
    File "subprocess.py", line 571, in run
subprocess.CalledProcessError: Command '[WindowsPath('C:/Users/Username/project/.venv_win/Scripts/python.exe'), WindowsPath('C:/Users/Username/project/manage.py'), 'migrate']' returned non-zero exit status 1.

[2025-05-01 10:54:14 AM] [WARNING] dev_tool.tui.menu.action: Command '[WindowsPath('C:/Users/Username/project/.venv_win/Scripts/python.exe'), WindowsPath('C:/Users/Username/project/manage.py'), 'migrate']' returned non-zero exit status 1.

Command failed. Press Enter to return to the menu.

Solution: You will need to clear the uv cache to resolve this issue:

  1. Press Win + R to open the Run dialog
  2. Enter %LOCALAPPDATA%\uv in the text field
  3. Click "OK"
  4. Locate and delete the cache directory
  5. Run "(Re)build the development environment" with the new Python version