can't install deps #4845

Closed
opened 2026-02-21 18:08:16 -05:00 by yindo · 5 comments
Owner

Originally created by @cjdxhjj on GitHub (Jul 31, 2024).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.6.15

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

poetry install

✔️ Expected Behavior

No response

Actual Behavior

 Unable to find installation candidates for onnxruntime (1.18.1)

  at .venv/lib/python3.10/site-packages/poetry/installation/chooser.py:74 in choose_for
       70│
       71│             links.append(link)
       72│
       73│         if not links:
    →  74│             raise RuntimeError(f"Unable to find installation candidates for {package}")
       75│
       76│         # Get the best link
       77│         chosen = max(links, key=lambda link: self._sort_key(package, link))
       78│

Cannot install onnxruntime.

  - Installing opentelemetry-exporter-otlp-proto-grpc (1.25.0)
  - Installing opentelemetry-instrumentation-fastapi (0.46b0)
  - Installing orjson (3.10.6)
  - Installing openpyxl (3.1.5)
  - Installing overrides (7.7.0)
  - Installing peewee (3.17.6)
  - Installing plotly (5.23.0): Installing...
  - Installing ply (3.11)
  - Installing posthog (3.5.0)
  - Installing psycopg2-binary (2.9.9)
  - Installing pymysql (1.1.1)
  - Installing pypandoc (1.13)
  - Installing pypika (0.48.9)
  - Installing pypng (0.20220715.0)
  - Installing kaleido (0.2.1)
  - Installing kiwisolver (1.4.5)
  - Installing kombu (5.3.7)
  - Installing kubernetes (30.1.0)
  - Installing langdetect (1.0.9)
  - Installing lz4 (4.3.3)
  - Installing markdown (3.5.2)
  - Installing milvus-lite (2.4.8)
  - Installing mmh3 (4.1.0)
  - Installing msal-extensions (1.2.0)
  - Installing msg-parser (1.2.0)
  - Installing msrest (0.7.1)
  - Installing multitasking (0.0.11)
  - Installing nltk (3.8.1)
  - Installing numba (0.60.0)
  - Installing numexpr (2.9.0)
  - Installing odfpy (1.4.1)
  - Installing onnxruntime (1.18.1): Failed

  RuntimeError

  Unable to find installation candidates for onnxruntime (1.18.1)

  at .venv/lib/python3.10/site-packages/poetry/installation/chooser.py:74 in choose_for
       70│
       71│             links.append(link)
       72│
       73│         if not links:
    →  74│             raise RuntimeError(f"Unable to find installation candidates for {package}")
       75│
       76│         # Get the best link
       77│         chosen = max(links, key=lambda link: self._sort_key(package, link))
       78│

Cannot install onnxruntime.

  - Installing opentelemetry-exporter-otlp-proto-grpc (1.25.0)
  - Installing opentelemetry-instrumentation-fastapi (0.46b0)
  - Installing orjson (3.10.6)
  - Installing openpyxl (3.1.5)
  - Installing overrides (7.7.0)
  - Installing peewee (3.17.6)
  - Installing plotly (5.23.0): Installing...
  - Installing ply (3.11)
  - Installing posthog (3.5.0)
  - Installing psycopg2-binary (2.9.9)
  - Installing pymysql (1.1.1)
  - Installing pypandoc (1.13)
  - Installing pypika (0.48.9)
  - Installing pypng (0.20220715.0)
  - Installing ply (3.11)
  - Installing posthog (3.5.0)
  - Installing psycopg2-binary (2.9.9)
  - Installing pymysql (1.1.1)
  - Installing pypandoc (1.13)
  - Installing pypika (0.48.9)
  - Installing pypng (0.20220715.0)
  - Installing plotly (5.23.0)
  - Installing ply (3.11)
  - Installing posthog (3.5.0)
  - Installing psycopg2-binary (2.9.9)
  - Installing pymysql (1.1.1)
  - Installing pypandoc (1.13)
  - Installing pypika (0.48.9)
  - Installing pypng (0.20220715.0)
  - Installing pyreqwest-impersonate (0.5.3)
  - Installing python-calamine (0.2.3)
  - Installing python-docx (1.1.2)
  - Installing python-iso639 (2024.4.27)
  - Installing python-magic (0.4.27)
  - Installing python-pptx (0.6.23)
  - Installing pyxlsb (1.0.10)
  - Downgrading rapidfuzz (3.9.5 -> 3.9.4)
  - Installing s3transfer (0.10.2)
  - Installing safetensors (0.4.3)
  - Installing scipy (1.14.0)
  - Installing shapely (2.0.5)
  - Installing socksio (1.0.0)
  - Installing sqlparse (0.5.1)
  - Installing tabulate (0.9.0)
  - Installing tencentcloud-sdk-python-common (3.0.1196)
  - Installing threadpoolctl (3.5.0)
  - Installing tiktoken (0.7.0)
  - Installing tinysegmenter (0.3)
  - Installing tldextract (5.1.2)
  - Installing tokenizers (0.15.2)
  - Installing toml (0.10.2)
  - Installing types-requests (2.32.0.20240712)
  - Installing ujson (5.10.0)
  - Installing validators (0.21.0)
  - Installing xlrd (2.0.1)
  - Installing zope-event (5.0)
  - Installing zope-interface (6.4.post2)
  - Installing zstandard (0.23.0)
Originally created by @cjdxhjj on GitHub (Jul 31, 2024). ### Self Checks - [X] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.6.15 ### Cloud or Self Hosted Self Hosted (Source) ### Steps to reproduce poetry install ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior ``` Unable to find installation candidates for onnxruntime (1.18.1) at .venv/lib/python3.10/site-packages/poetry/installation/chooser.py:74 in choose_for 70│ 71│ links.append(link) 72│ 73│ if not links: → 74│ raise RuntimeError(f"Unable to find installation candidates for {package}") 75│ 76│ # Get the best link 77│ chosen = max(links, key=lambda link: self._sort_key(package, link)) 78│ Cannot install onnxruntime. - Installing opentelemetry-exporter-otlp-proto-grpc (1.25.0) - Installing opentelemetry-instrumentation-fastapi (0.46b0) - Installing orjson (3.10.6) - Installing openpyxl (3.1.5) - Installing overrides (7.7.0) - Installing peewee (3.17.6) - Installing plotly (5.23.0): Installing... - Installing ply (3.11) - Installing posthog (3.5.0) - Installing psycopg2-binary (2.9.9) - Installing pymysql (1.1.1) - Installing pypandoc (1.13) - Installing pypika (0.48.9) - Installing pypng (0.20220715.0) - Installing kaleido (0.2.1) - Installing kiwisolver (1.4.5) - Installing kombu (5.3.7) - Installing kubernetes (30.1.0) - Installing langdetect (1.0.9) - Installing lz4 (4.3.3) - Installing markdown (3.5.2) - Installing milvus-lite (2.4.8) - Installing mmh3 (4.1.0) - Installing msal-extensions (1.2.0) - Installing msg-parser (1.2.0) - Installing msrest (0.7.1) - Installing multitasking (0.0.11) - Installing nltk (3.8.1) - Installing numba (0.60.0) - Installing numexpr (2.9.0) - Installing odfpy (1.4.1) - Installing onnxruntime (1.18.1): Failed RuntimeError Unable to find installation candidates for onnxruntime (1.18.1) at .venv/lib/python3.10/site-packages/poetry/installation/chooser.py:74 in choose_for 70│ 71│ links.append(link) 72│ 73│ if not links: → 74│ raise RuntimeError(f"Unable to find installation candidates for {package}") 75│ 76│ # Get the best link 77│ chosen = max(links, key=lambda link: self._sort_key(package, link)) 78│ Cannot install onnxruntime. - Installing opentelemetry-exporter-otlp-proto-grpc (1.25.0) - Installing opentelemetry-instrumentation-fastapi (0.46b0) - Installing orjson (3.10.6) - Installing openpyxl (3.1.5) - Installing overrides (7.7.0) - Installing peewee (3.17.6) - Installing plotly (5.23.0): Installing... - Installing ply (3.11) - Installing posthog (3.5.0) - Installing psycopg2-binary (2.9.9) - Installing pymysql (1.1.1) - Installing pypandoc (1.13) - Installing pypika (0.48.9) - Installing pypng (0.20220715.0) - Installing ply (3.11) - Installing posthog (3.5.0) - Installing psycopg2-binary (2.9.9) - Installing pymysql (1.1.1) - Installing pypandoc (1.13) - Installing pypika (0.48.9) - Installing pypng (0.20220715.0) - Installing plotly (5.23.0) - Installing ply (3.11) - Installing posthog (3.5.0) - Installing psycopg2-binary (2.9.9) - Installing pymysql (1.1.1) - Installing pypandoc (1.13) - Installing pypika (0.48.9) - Installing pypng (0.20220715.0) - Installing pyreqwest-impersonate (0.5.3) - Installing python-calamine (0.2.3) - Installing python-docx (1.1.2) - Installing python-iso639 (2024.4.27) - Installing python-magic (0.4.27) - Installing python-pptx (0.6.23) - Installing pyxlsb (1.0.10) - Downgrading rapidfuzz (3.9.5 -> 3.9.4) - Installing s3transfer (0.10.2) - Installing safetensors (0.4.3) - Installing scipy (1.14.0) - Installing shapely (2.0.5) - Installing socksio (1.0.0) - Installing sqlparse (0.5.1) - Installing tabulate (0.9.0) - Installing tencentcloud-sdk-python-common (3.0.1196) - Installing threadpoolctl (3.5.0) - Installing tiktoken (0.7.0) - Installing tinysegmenter (0.3) - Installing tldextract (5.1.2) - Installing tokenizers (0.15.2) - Installing toml (0.10.2) - Installing types-requests (2.32.0.20240712) - Installing ujson (5.10.0) - Installing validators (0.21.0) - Installing xlrd (2.0.1) - Installing zope-event (5.0) - Installing zope-interface (6.4.post2) - Installing zstandard (0.23.0) ```
yindo added the 🤔 cant-reproduce label 2026-02-21 18:08:16 -05:00
yindo closed this issue 2026-02-21 18:08:16 -05:00
Author
Owner

@cjdxhjj commented on GitHub (Jul 31, 2024):

unable to install onnxruntime,kaleido

@cjdxhjj commented on GitHub (Jul 31, 2024): unable to install onnxruntime,kaleido
Author
Owner

@dosubot[bot] commented on GitHub (Jul 31, 2024):

To resolve the issue with installing onnxruntime and kaleido using Poetry for Dify version 0.6.15 in a self-hosted environment, follow these steps:

  1. Ensure you have Python 3.10.x installed and activated in your environment.

  2. Navigate to the "api" directory:

    cd api
    
  3. Copy the environment variable configuration file:

    cp .env.example .env
    
  4. Generate a random secret key and replace the value of SECRET_KEY in the .env file:

    openssl rand -base64 42
    sed -i 's/SECRET_KEY=.*/SECRET_KEY=<your_value>/' .env
    
  5. Install the required dependencies using Poetry:

    poetry install
    

If you encounter issues specifically with onnxruntime and kaleido, you can add them directly to your pyproject.toml file under the [tool.poetry.dependencies] section:

[tool.poetry.dependencies]
python = "^3.10"
onnxruntime = "^1.10.0"
kaleido = "^0.2.1"

Then, run the following command to install the dependencies:

poetry update

Additionally, if you are using Docker for your self-hosted environment, ensure your Dockerfile is set up correctly. Here is an example Dockerfile for Dify:

# base image
FROM python:3.10-slim-bookworm AS base

WORKDIR /app/api

# Install Poetry
ENV POETRY_VERSION=1.8.3
RUN pip install --no-cache-dir --upgrade pip && \
    pip install --no-cache-dir --upgrade poetry==${POETRY_VERSION}

# Configure Poetry
ENV POETRY_CACHE_DIR=/tmp/poetry_cache
ENV POETRY_NO_INTERACTION=1
ENV POETRY_VIRTUALENVS_IN_PROJECT=true
ENV POETRY_VIRTUALENVS_CREATE=true

FROM base AS packages

RUN apt-get update \
    && apt-get install -y --no-install-recommends gcc g++ libc-dev libffi-dev libgmp-dev libmpfr-dev libmpc-dev

# Install Python dependencies
COPY pyproject.toml poetry.lock ./
RUN poetry install --sync --no-cache --no-root

# production stage
FROM base AS production

ENV FLASK_APP=app.py
ENV EDITION=SELF_HOSTED
ENV DEPLOY_ENV=PRODUCTION
ENV CONSOLE_API_URL=http://127.0.0.1:5001
ENV CONSOLE_WEB_URL=http://127.0.0.1:3000
ENV SERVICE_API_URL=http://127.0.0.1:5001
ENV APP_WEB_URL=http://127.0.0.1:3000

EXPOSE 5001

# set timezone
ENV TZ=UTC

WORKDIR /app/api

RUN apt-get update \
    && apt-get install -y --no-install-recommends curl wget vim nodejs ffmpeg libgmp-dev libmpfr-dev libmpc-dev \
    && apt-get autoremove \
    && rm -rf /var/lib/apt/lists/*

# Copy Python environment and packages
ENV VIRTUAL_ENV=/app/api/.venv
COPY --from=packages ${VIRTUAL_ENV} ${VIRTUAL_ENV}
ENV PATH="${VIRTUAL_ENV}/bin:${PATH}"

# Copy source code
COPY . /app/api/

# Copy entrypoint
COPY docker/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

ARG COMMIT_SHA
ENV COMMIT_SHA=${COMMIT_SHA}

ENTRYPOINT ["/bin/bash", "/entrypoint.sh"]

This should resolve the installation issues for onnxruntime and kaleido in your self-hosted environment for Dify version 0.6.15 [1][2].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Jul 31, 2024): <!-- Answer --> To resolve the issue with installing `onnxruntime` and `kaleido` using Poetry for Dify version 0.6.15 in a self-hosted environment, follow these steps: 1. Ensure you have Python 3.10.x installed and activated in your environment. 2. Navigate to the "api" directory: ```bash cd api ``` 3. Copy the environment variable configuration file: ```bash cp .env.example .env ``` 4. Generate a random secret key and replace the value of `SECRET_KEY` in the `.env` file: ```bash openssl rand -base64 42 sed -i 's/SECRET_KEY=.*/SECRET_KEY=<your_value>/' .env ``` 5. Install the required dependencies using Poetry: ```bash poetry install ``` If you encounter issues specifically with `onnxruntime` and `kaleido`, you can add them directly to your `pyproject.toml` file under the `[tool.poetry.dependencies]` section: ```toml [tool.poetry.dependencies] python = "^3.10" onnxruntime = "^1.10.0" kaleido = "^0.2.1" ``` Then, run the following command to install the dependencies: ```bash poetry update ``` Additionally, if you are using Docker for your self-hosted environment, ensure your Dockerfile is set up correctly. Here is an example Dockerfile for Dify: ```dockerfile # base image FROM python:3.10-slim-bookworm AS base WORKDIR /app/api # Install Poetry ENV POETRY_VERSION=1.8.3 RUN pip install --no-cache-dir --upgrade pip && \ pip install --no-cache-dir --upgrade poetry==${POETRY_VERSION} # Configure Poetry ENV POETRY_CACHE_DIR=/tmp/poetry_cache ENV POETRY_NO_INTERACTION=1 ENV POETRY_VIRTUALENVS_IN_PROJECT=true ENV POETRY_VIRTUALENVS_CREATE=true FROM base AS packages RUN apt-get update \ && apt-get install -y --no-install-recommends gcc g++ libc-dev libffi-dev libgmp-dev libmpfr-dev libmpc-dev # Install Python dependencies COPY pyproject.toml poetry.lock ./ RUN poetry install --sync --no-cache --no-root # production stage FROM base AS production ENV FLASK_APP=app.py ENV EDITION=SELF_HOSTED ENV DEPLOY_ENV=PRODUCTION ENV CONSOLE_API_URL=http://127.0.0.1:5001 ENV CONSOLE_WEB_URL=http://127.0.0.1:3000 ENV SERVICE_API_URL=http://127.0.0.1:5001 ENV APP_WEB_URL=http://127.0.0.1:3000 EXPOSE 5001 # set timezone ENV TZ=UTC WORKDIR /app/api RUN apt-get update \ && apt-get install -y --no-install-recommends curl wget vim nodejs ffmpeg libgmp-dev libmpfr-dev libmpc-dev \ && apt-get autoremove \ && rm -rf /var/lib/apt/lists/* # Copy Python environment and packages ENV VIRTUAL_ENV=/app/api/.venv COPY --from=packages ${VIRTUAL_ENV} ${VIRTUAL_ENV} ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" # Copy source code COPY . /app/api/ # Copy entrypoint COPY docker/entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh ARG COMMIT_SHA ENV COMMIT_SHA=${COMMIT_SHA} ENTRYPOINT ["/bin/bash", "/entrypoint.sh"] ``` This should resolve the installation issues for `onnxruntime` and `kaleido` in your self-hosted environment for Dify version 0.6.15 <sup>[[1]](https://github.com/langgenius/dify-docs/blob/main/en/getting-started/install-self-hosted/local-source-code.md)</sup><sup>[[2]](https://github.com/langgenius/dify/blob/main/api/Dockerfile)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@crazywoola commented on GitHub (Jul 31, 2024):

https://github.com/langgenius/dify/issues/5898#issuecomment-2205320173

@crazywoola commented on GitHub (Jul 31, 2024): https://github.com/langgenius/dify/issues/5898#issuecomment-2205320173
Author
Owner

@crazywoola commented on GitHub (Jul 31, 2024):

Unable to find installation candidates for onnxruntime (1.18.1)

It should be onnxruntime==1.16.3

@crazywoola commented on GitHub (Jul 31, 2024): > Unable to find installation candidates for onnxruntime (1.18.1) It should be `onnxruntime==1.16.3`
Author
Owner

@Omnithyn commented on GitHub (Aug 3, 2024):

When performing poetry install in the Linux environment, onnxruntime and kaleido cannot be installed, with respective error messages being Unable to find installation candidates for kaleido (0.2.1.post1) and Unable to find installation candidates for onnxruntime (1.18.1). Even with the configuration

[tool.poetry.dependencies]
python = "^3.10"
onnxruntime = "^1.10.0"
kaleido = "^0.2.1"

the installation still cannot be completed.

@Omnithyn commented on GitHub (Aug 3, 2024): When performing poetry install in the Linux environment, onnxruntime and kaleido cannot be installed, with respective error messages being `Unable to find installation candidates for kaleido (0.2.1.post1)` and `Unable to find installation candidates for onnxruntime (1.18.1)`. Even with the configuration ``` [tool.poetry.dependencies] python = "^3.10" onnxruntime = "^1.10.0" kaleido = "^0.2.1" ``` the installation still cannot be completed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#4845