Immich Machine Learning container error "import name 'deprecated' from 'typing_extensions'" #7356

Closed
opened 2026-02-05 12:58:20 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @sendev1 on GitHub (Sep 27, 2025).

I have searched the existing issues, both open and closed, to make sure this is not a duplicate report.

  • Yes

The bug

I am running release version of immich, i pulled the images today and ran and i belive it is using v1.143.1. I am sesing this error in my machine learning container

ImportError: cannot import name 'deprecated' from 'typing_extensions' (/opt/venv/lib/python3.11/site-packages/typing_extensions.py)
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/src/immich_ml/__main__.py", line 6, in <module>
    from .config import log, non_prefixed_settings, settings
  File "/usr/src/immich_ml/config.py", line 9, in <module>
    from pydantic import BaseModel
  File "/opt/venv/lib/python3.11/site-packages/pydantic/__init__.py", line 5, in <module>
    from ._migration import getattr_migration
  File "/opt/venv/lib/python3.11/site-packages/pydantic/_migration.py", line 4, in <module>
    from .version import version_short
  File "/opt/venv/lib/python3.11/site-packages/pydantic/version.py", line 5, in <module>
    from pydantic_core import __version__ as __pydantic_core_version__
  File "/opt/venv/lib/python3.11/site-packages/pydantic_core/__init__.py", line 30, in <module>
    from .core_schema import CoreConfig, CoreSchema, CoreSchemaType, ErrorType
  File "/opt/venv/lib/python3.11/site-packages/pydantic_core/core_schema.py", line 16, in <module>
    from typing_extensions import deprecated

This error appears multiple times.

The OS that Immich Server is running on

Raspberry Pi OS Lite

Version of Immich Server

v1.143.1

Version of Immich Mobile App

v1.143.1

Platform with the issue

  • Server
  • Web
  • Mobile

Device make and model

Raspberry Pi

Your docker-compose.yml content

my docker file for immich learning looks like this

      immich-machine-learning:
        container_name: immich_machine_learning
        mem_limit: 1024m
        # For hardware acceleration, add one of -[armnn, cuda, rocm, openvino, rknn] to the image tag.
        # Example tag: ${IMMICH_VERSION:-release}-cuda
        image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
        # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration
        #   file: hwaccel.ml.yml
        #   service: cpu # set to one of [armnn, cuda, rocm, openvino, openvino-wsl, rknn] for accelerated inference - use the `-wsl` version for WSL2 where applicable
        volumes:
            - model-cache:/cache
      env_file:
        - .env
      restart: unless-stopped
      networks:
        - immich-net
      healthcheck:
        disable: false

Your .env content

# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables

# The location where your uploaded files are stored
UPLOAD_LOCATION=/shared/backup/Immich_Photo_Library

# To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
TZ=America/Chicago

# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=release

# Connection secret for postgres. You should change it to a random password
# Please use only the characters `A-Za-z0-9`, without special characters or spaces
DB_PASSWORD=redacted
DB_DATA_LOCATION=./data
IMMICH_MACHINE_LEARNING_URL=http://remote-ip:3003
# The values below this line do not need to be changed
###################################################################################
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

Reproduction steps

  1. Just stated container and seeing errors

...

Relevant log output


Additional information

No response

Originally created by @sendev1 on GitHub (Sep 27, 2025). ### I have searched the existing issues, both open and closed, to make sure this is not a duplicate report. - [x] Yes ### The bug I am running release version of immich, i pulled the images today and ran and i belive it is using v1.143.1. I am sesing this error in my machine learning container ``` ImportError: cannot import name 'deprecated' from 'typing_extensions' (/opt/venv/lib/python3.11/site-packages/typing_extensions.py) Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "/usr/src/immich_ml/__main__.py", line 6, in <module> from .config import log, non_prefixed_settings, settings File "/usr/src/immich_ml/config.py", line 9, in <module> from pydantic import BaseModel File "/opt/venv/lib/python3.11/site-packages/pydantic/__init__.py", line 5, in <module> from ._migration import getattr_migration File "/opt/venv/lib/python3.11/site-packages/pydantic/_migration.py", line 4, in <module> from .version import version_short File "/opt/venv/lib/python3.11/site-packages/pydantic/version.py", line 5, in <module> from pydantic_core import __version__ as __pydantic_core_version__ File "/opt/venv/lib/python3.11/site-packages/pydantic_core/__init__.py", line 30, in <module> from .core_schema import CoreConfig, CoreSchema, CoreSchemaType, ErrorType File "/opt/venv/lib/python3.11/site-packages/pydantic_core/core_schema.py", line 16, in <module> from typing_extensions import deprecated ``` This error appears multiple times. ### The OS that Immich Server is running on Raspberry Pi OS Lite ### Version of Immich Server v1.143.1 ### Version of Immich Mobile App v1.143.1 ### Platform with the issue - [x] Server - [ ] Web - [ ] Mobile ### Device make and model Raspberry Pi ### Your docker-compose.yml content ```YAML my docker file for immich learning looks like this immich-machine-learning: container_name: immich_machine_learning mem_limit: 1024m # For hardware acceleration, add one of -[armnn, cuda, rocm, openvino, rknn] to the image tag. # Example tag: ${IMMICH_VERSION:-release}-cuda image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release} # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration # file: hwaccel.ml.yml # service: cpu # set to one of [armnn, cuda, rocm, openvino, openvino-wsl, rknn] for accelerated inference - use the `-wsl` version for WSL2 where applicable volumes: - model-cache:/cache env_file: - .env restart: unless-stopped networks: - immich-net healthcheck: disable: false ``` ### Your .env content ```Shell # You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables # The location where your uploaded files are stored UPLOAD_LOCATION=/shared/backup/Immich_Photo_Library # To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List TZ=America/Chicago # The Immich version to use. You can pin this to a specific version like "v1.71.0" IMMICH_VERSION=release # Connection secret for postgres. You should change it to a random password # Please use only the characters `A-Za-z0-9`, without special characters or spaces DB_PASSWORD=redacted DB_DATA_LOCATION=./data IMMICH_MACHINE_LEARNING_URL=http://remote-ip:3003 # The values below this line do not need to be changed ################################################################################### DB_USERNAME=postgres DB_DATABASE_NAME=immich ``` ### Reproduction steps 1. Just stated container and seeing errors 2. 3. ... ### Relevant log output ```shell ``` ### Additional information _No response_
Author
Owner

@bo0tzz commented on GitHub (Sep 27, 2025):

Can you try deleting and re-pulling the ML image?

@bo0tzz commented on GitHub (Sep 27, 2025): Can you try deleting and re-pulling the ML image?
Author
Owner

@sendev1 commented on GitHub (Sep 27, 2025):

Yeah I tried that yesterday night, but no luck.

On Sat, Sep 27, 2025 at 10:00 AM bo0tzz @.***> wrote:

bo0tzz left a comment (immich-app/immich#22429)
https://github.com/immich-app/immich/issues/22429#issuecomment-3341842071

Can you try deleting and re-pulling the ML image?


Reply to this email directly, view it on GitHub
https://github.com/immich-app/immich/issues/22429#issuecomment-3341842071,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AQLELADHLKV2T3IGW54DFNL3U2RBLAVCNFSM6AAAAACHUBYBNKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTGNBRHA2DEMBXGE
.
You are receiving this because you authored the thread.Message ID:
@.***>

@sendev1 commented on GitHub (Sep 27, 2025): Yeah I tried that yesterday night, but no luck. On Sat, Sep 27, 2025 at 10:00 AM bo0tzz ***@***.***> wrote: > *bo0tzz* left a comment (immich-app/immich#22429) > <https://github.com/immich-app/immich/issues/22429#issuecomment-3341842071> > > Can you try deleting and re-pulling the ML image? > > — > Reply to this email directly, view it on GitHub > <https://github.com/immich-app/immich/issues/22429#issuecomment-3341842071>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AQLELADHLKV2T3IGW54DFNL3U2RBLAVCNFSM6AAAAACHUBYBNKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTGNBRHA2DEMBXGE> > . > You are receiving this because you authored the thread.Message ID: > ***@***.***> >
Author
Owner

@sendev1 commented on GitHub (Sep 27, 2025):

I tried running v1.143.0 on my raspberry pi and still the same error. I tried all the steps event chat gpt suggested but none worked.
chat gpt said something like this.

immich-machine-learning:
  container_name: immich_machine_learning
  mem_limit: 1024m
  image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
  entrypoint: >
    sh -c "pip install --no-cache-dir --upgrade typing_extensions &&
           python -m immich_ml"
  volumes:
    - model-cache:/cache
  env_file:
    - .env
  restart: unless-stopped
  networks:
    - immich-net
  healthcheck:
    disable: false
@sendev1 commented on GitHub (Sep 27, 2025): I tried running v1.143.0 on my raspberry pi and still the same error. I tried all the steps event chat gpt suggested but none worked. chat gpt said something like this. ``` immich-machine-learning: container_name: immich_machine_learning mem_limit: 1024m image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release} entrypoint: > sh -c "pip install --no-cache-dir --upgrade typing_extensions && python -m immich_ml" volumes: - model-cache:/cache env_file: - .env restart: unless-stopped networks: - immich-net healthcheck: disable: false ```
Author
Owner

@bo0tzz commented on GitHub (Sep 27, 2025):

chatgpt isn't gonna have anything useful to say here. @mertalev any ideas?

@bo0tzz commented on GitHub (Sep 27, 2025): chatgpt isn't gonna have anything useful to say here. @mertalev any ideas?
Author
Owner

@sendev1 commented on GitHub (Oct 1, 2025):

After running docker compose down docker system prune -a the issue gone. maybe be images were corrupted. closing this issue

@sendev1 commented on GitHub (Oct 1, 2025): After running docker compose down docker system prune -a the issue gone. maybe be images were corrupted. closing this issue
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#7356