microsoft / TaskWeaver

A code-first agent framework for seamlessly planning and executing data analytics tasks.
https://microsoft.github.io/TaskWeaver/
MIT License
5.19k stars 661 forks source link

Hosting Taskweaver online #212

Closed KawniX closed 6 months ago

KawniX commented 6 months ago

Hi! I am trying to host taskweaver online but I can't get it to work even if I install using git. I have tried to do the following and it still says it cannot find the module taskweaver. I am trying to use the Web UI. When I do this locally on my environment it works but for some reason using docker doesn't work.

Try 1: RUN pip install git+https://github.com/microsoft/TaskWeaver.git

Try 2: RUN git clone https://github.com/microsoft/TaskWeaver.git RUN pip install -e ./TaskWeaver

Try 3: RUN git clone https://github.com/microsoft/TaskWeaver.git && \ cd TaskWeaver && \ pip install -e .

This is my full dockerfile for comparison:

FROM python:3.11-slim as python-base

ENV PYTHONUNBUFFERED=1 \
    PYTHONDONTWRITEBYTECODE=1 \
    \
    PIP_NO_CACHE_DIR=off \
    PIP_DISABLE_PIP_VERSION_CHECK=on \
    PIP_DEFAULT_TIMEOUT=100 \
    \
    POETRY_VERSION=1.4.2 \
    POETRY_HOME="/opt/poetry" \
    POETRY_VIRTUALENVS_IN_PROJECT=true \
    POETRY_NO_INTERACTION=1 \
    \
    PYSETUP_PATH="/opt/pysetup" \
    VENV_PATH="/opt/pysetup/.venv"

ENV PATH="$POETRY_HOME/bin:$VENV_PATH/bin:$PATH"

FROM python-base as builder-base
RUN apt-get update \
    && apt-get install --no-install-recommends -y \
    # deps for installing poetry
    curl \
    # deps for building python deps
    build-essential libpq-dev git

RUN curl -sSL https://install.python-poetry.org | python3 -

WORKDIR $PYSETUP_PATH

# RUN pip install git+https://github.com/microsoft/TaskWeaver.git

# RUN git clone https://github.com/microsoft/TaskWeaver.git
# RUN pip install -e ./TaskWeaver

# RUN git clone https://github.com/microsoft/TaskWeaver.git && \
#     cd TaskWeaver && \
#     pip install -e .

COPY poetry.lock pyproject.toml ./

RUN poetry config installer.max-workers 10

RUN poetry install --only main 

FROM python-base as production

RUN apt-get update && apt-get install -y unzip wget libreoffice

COPY --from=builder-base $PYSETUP_PATH $PYSETUP_PATH
WORKDIR /app
COPY ./ ./

EXPOSE 8080
ENTRYPOINT [ "chainlit", "run", "app.py", "--port", "8080" ]
KawniX commented 6 months ago

Just adding the logs that I have. So it seems like I am able to install the package but it cannot be found by my application? Please let me know if I get it wrong. See my logs:

2024-02-22 18:18:25 2024-02-22 10:18:25 - Loaded .env file
2024-02-22 18:18:28 Obtaining file:///app/TaskWeaver
2024-02-22 18:18:28   Preparing metadata (setup.py): started
2024-02-22 18:18:28   Preparing metadata (setup.py): finished with status 'done'
2024-02-22 18:18:28 Requirement already satisfied: numpy>=1.24.2 in /opt/pysetup/.venv/lib/python3.11/site-packages (from taskweaver==0.0.12a0+local.20240222101828) (1.26.4)
2024-02-22 18:18:28 Requirement already satisfied: pandas>=2.0.0 in /opt/pysetup/.venv/lib/python3.11/site-packages (from taskweaver==0.0.12a0+local.20240222101828) (2.2.0)
2024-02-22 18:18:28 Requirement already satisfied: matplotlib>=3.4 in /opt/pysetup/.venv/lib/python3.11/site-packages (from taskweaver==0.0.12a0+local.20240222101828) (3.8.3)
2024-02-22 18:18:28 Requirement already satisfied: seaborn>=0.11 in /opt/pysetup/.venv/lib/python3.11/site-packages (from taskweaver==0.0.12a0+local.20240222101828) (0.13.2)
2024-02-22 18:18:28 Requirement already satisfied: python-dotenv>=1.0.0 in /opt/pysetup/.venv/lib/python3.11/site-packages (from taskweaver==0.0.12a0+local.20240222101828) (1.0.1)
2024-02-22 18:18:28 Requirement already satisfied: openai>=1.2.4 in /opt/pysetup/.venv/lib/python3.11/site-packages (from taskweaver==0.0.12a0+local.20240222101828) (1.12.0)
2024-02-22 18:18:28 Requirement already satisfied: pyyaml>=6.0 in /opt/pysetup/.venv/lib/python3.11/site-packages (from taskweaver==0.0.12a0+local.20240222101828) (6.0.1)
2024-02-22 18:18:28 Requirement already satisfied: scikit-learn>=1.2.2 in /opt/pysetup/.venv/lib/python3.11/site-packages (from taskweaver==0.0.12a0+local.20240222101828) (1.4.1.post1)
2024-02-22 18:18:28 Requirement already satisfied: click>=8.0.1 in /opt/pysetup/.venv/lib/python3.11/site-packages (from taskweaver==0.0.12a0+local.20240222101828) (8.1.7)
2024-02-22 18:18:28 Requirement already satisfied: urllib3>=1.26.17 in /opt/pysetup/.venv/lib/python3.11/site-packages (from taskweaver==0.0.12a0+local.20240222101828) (2.2.1)
2024-02-22 18:18:28 Requirement already satisfied: jsonschema==4.20.0 in /opt/pysetup/.venv/lib/python3.11/site-packages (from taskweaver==0.0.12a0+local.20240222101828) (4.20.0)
2024-02-22 18:18:28 Requirement already satisfied: injector>=0.21.0 in /opt/pysetup/.venv/lib/python3.11/site-packages (from taskweaver==0.0.12a0+local.20240222101828) (0.21.0)
2024-02-22 18:18:28 Requirement already satisfied: ijson>=3.2.3 in /opt/pysetup/.venv/lib/python3.11/site-packages (from taskweaver==0.0.12a0+local.20240222101828) (3.2.3)
2024-02-22 18:18:28 Requirement already satisfied: requests>=2.31.0 in /opt/pysetup/.venv/lib/python3.11/site-packages (from taskweaver==0.0.12a0+local.20240222101828) (2.31.0)
2024-02-22 18:18:28 Requirement already satisfied: ipykernel==6.26.0 in /opt/pysetup/.venv/lib/python3.11/site-packages (from taskweaver==0.0.12a0+local.20240222101828) (6.26.0)
2024-02-22 18:18:28 Requirement already satisfied: pre-commit>=2.19.0 in /opt/pysetup/.venv/lib/python3.11/site-packages (from taskweaver==0.0.12a0+local.20240222101828) (3.6.2)
2024-02-22 18:18:28 Requirement already satisfied: tenacity>=8.2.2 in /opt/pysetup/.venv/lib/python3.11/site-packages (from taskweaver==0.0.12a0+local.20240222101828) (8.2.3)
2024-02-22 18:18:28 Requirement already satisfied: plotly>=5.14.1 in /opt/pysetup/.venv/lib/python3.11/site-packages (from taskweaver==0.0.12a0+local.20240222101828) (5.19.0)
2024-02-22 18:18:28 Requirement already satisfied: pytest>=7.0.0 in /opt/pysetup/.venv/lib/python3.11/site-packages (from taskweaver==0.0.12a0+local.20240222101828) (8.0.1)
2024-02-22 18:18:28 Requirement already satisfied: vcrpy>=5.0.0 in /opt/pysetup/.venv/lib/python3.11/site-packages (from taskweaver==0.0.12a0+local.20240222101828) (5.1.0)
2024-02-22 18:18:28 Requirement already satisfied: colorama>=0.4.6 in /opt/pysetup/.venv/lib/python3.11/site-packages (from taskweaver==0.0.12a0+local.20240222101828) (0.4.6)
2024-02-22 18:18:28 Requirement already satisfied: comm>=0.1.1 in /opt/pysetup/.venv/lib/python3.11/site-packages (from ipykernel==6.26.0->taskweaver==0.0.12a0+local.20240222101828) (0.2.1)
2024-02-22 18:18:28 Requirement already satisfied: debugpy>=1.6.5 in /opt/pysetup/.venv/lib/python3.11/site-packages (from ipykernel==6.26.0->taskweaver==0.0.12a0+local.20240222101828) (1.8.1)
2024-02-22 18:18:28 Requirement already satisfied: ipython>=7.23.1 in /opt/pysetup/.venv/lib/python3.11/site-packages (from ipykernel==6.26.0->taskweaver==0.0.12a0+local.20240222101828) (8.21.0)
2024-02-22 18:18:28 Requirement already satisfied: jupyter-client>=6.1.12 in /opt/pysetup/.venv/lib/python3.11/site-packages (from ipykernel==6.26.0->taskweaver==0.0.12a0+local.20240222101828) (8.6.0)
2024-02-22 18:18:28 Requirement already satisfied: jupyter-core!=5.0.*,>=4.12 in /opt/pysetup/.venv/lib/python3.11/site-packages (from ipykernel==6.26.0->taskweaver==0.0.12a0+local.20240222101828) (5.7.1)
2024-02-22 18:18:28 Requirement already satisfied: matplotlib-inline>=0.1 in /opt/pysetup/.venv/lib/python3.11/site-packages (from ipykernel==6.26.0->taskweaver==0.0.12a0+local.20240222101828) (0.1.6)
2024-02-22 18:18:28 Requirement already satisfied: nest-asyncio in /opt/pysetup/.venv/lib/python3.11/site-packages (from ipykernel==6.26.0->taskweaver==0.0.12a0+local.20240222101828) (1.6.0)
2024-02-22 18:18:28 Requirement already satisfied: packaging in /opt/pysetup/.venv/lib/python3.11/site-packages (from ipykernel==6.26.0->taskweaver==0.0.12a0+local.20240222101828) (23.2)
2024-02-22 18:18:28 Requirement already satisfied: psutil in /opt/pysetup/.venv/lib/python3.11/site-packages (from ipykernel==6.26.0->taskweaver==0.0.12a0+local.20240222101828) (5.9.8)
2024-02-22 18:18:28 Requirement already satisfied: pyzmq>=20 in /opt/pysetup/.venv/lib/python3.11/site-packages (from ipykernel==6.26.0->taskweaver==0.0.12a0+local.20240222101828) (25.1.2)
2024-02-22 18:18:28 Requirement already satisfied: tornado>=6.1 in /opt/pysetup/.venv/lib/python3.11/site-packages (from ipykernel==6.26.0->taskweaver==0.0.12a0+local.20240222101828) (6.4)
2024-02-22 18:18:28 Requirement already satisfied: traitlets>=5.4.0 in /opt/pysetup/.venv/lib/python3.11/site-packages (from ipykernel==6.26.0->taskweaver==0.0.12a0+local.20240222101828) (5.14.1)
2024-02-22 18:18:28 Requirement already satisfied: attrs>=22.2.0 in /opt/pysetup/.venv/lib/python3.11/site-packages (from jsonschema==4.20.0->taskweaver==0.0.12a0+local.20240222101828) (23.2.0)
2024-02-22 18:18:28 Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /opt/pysetup/.venv/lib/python3.11/site-packages (from jsonschema==4.20.0->taskweaver==0.0.12a0+local.20240222101828) (2023.12.1)
2024-02-22 18:18:28 Requirement already satisfied: referencing>=0.28.4 in /opt/pysetup/.venv/lib/python3.11/site-packages (from jsonschema==4.20.0->taskweaver==0.0.12a0+local.20240222101828) (0.33.0)
2024-02-22 18:18:28 Requirement already satisfied: rpds-py>=0.7.1 in /opt/pysetup/.venv/lib/python3.11/site-packages (from jsonschema==4.20.0->taskweaver==0.0.12a0+local.20240222101828) (0.18.0)
2024-02-22 18:18:28 Requirement already satisfied: contourpy>=1.0.1 in /opt/pysetup/.venv/lib/python3.11/site-packages (from matplotlib>=3.4->taskweaver==0.0.12a0+local.20240222101828) (1.2.0)
2024-02-22 18:18:28 Requirement already satisfied: cycler>=0.10 in /opt/pysetup/.venv/lib/python3.11/site-packages (from matplotlib>=3.4->taskweaver==0.0.12a0+local.20240222101828) (0.12.1)
2024-02-22 18:18:28 Requirement already satisfied: fonttools>=4.22.0 in /opt/pysetup/.venv/lib/python3.11/site-packages (from matplotlib>=3.4->taskweaver==0.0.12a0+local.20240222101828) (4.49.0)
2024-02-22 18:18:28 Requirement already satisfied: kiwisolver>=1.3.1 in /opt/pysetup/.venv/lib/python3.11/site-packages (from matplotlib>=3.4->taskweaver==0.0.12a0+local.20240222101828) (1.4.5)
2024-02-22 18:18:28 Requirement already satisfied: pillow>=8 in /opt/pysetup/.venv/lib/python3.11/site-packages (from matplotlib>=3.4->taskweaver==0.0.12a0+local.20240222101828) (10.2.0)
2024-02-22 18:18:28 Requirement already satisfied: pyparsing>=2.3.1 in /opt/pysetup/.venv/lib/python3.11/site-packages (from matplotlib>=3.4->taskweaver==0.0.12a0+local.20240222101828) (3.1.1)
2024-02-22 18:18:28 Requirement already satisfied: python-dateutil>=2.7 in /opt/pysetup/.venv/lib/python3.11/site-packages (from matplotlib>=3.4->taskweaver==0.0.12a0+local.20240222101828) (2.8.2)
2024-02-22 18:18:28 Requirement already satisfied: anyio<5,>=3.5.0 in /opt/pysetup/.venv/lib/python3.11/site-packages (from openai>=1.2.4->taskweaver==0.0.12a0+local.20240222101828) (3.7.1)
2024-02-22 18:18:28 Requirement already satisfied: distro<2,>=1.7.0 in /opt/pysetup/.venv/lib/python3.11/site-packages (from openai>=1.2.4->taskweaver==0.0.12a0+local.20240222101828) (1.9.0)
2024-02-22 18:18:28 Requirement already satisfied: httpx<1,>=0.23.0 in /opt/pysetup/.venv/lib/python3.11/site-packages (from openai>=1.2.4->taskweaver==0.0.12a0+local.20240222101828) (0.24.1)
2024-02-22 18:18:28 Requirement already satisfied: pydantic<3,>=1.9.0 in /opt/pysetup/.venv/lib/python3.11/site-packages (from openai>=1.2.4->taskweaver==0.0.12a0+local.20240222101828) (2.6.1)
2024-02-22 18:18:28 Requirement already satisfied: sniffio in /opt/pysetup/.venv/lib/python3.11/site-packages (from openai>=1.2.4->taskweaver==0.0.12a0+local.20240222101828) (1.3.0)
2024-02-22 18:18:28 Requirement already satisfied: tqdm>4 in /opt/pysetup/.venv/lib/python3.11/site-packages (from openai>=1.2.4->taskweaver==0.0.12a0+local.20240222101828) (4.66.2)
2024-02-22 18:18:28 Requirement already satisfied: typing-extensions<5,>=4.7 in /opt/pysetup/.venv/lib/python3.11/site-packages (from openai>=1.2.4->taskweaver==0.0.12a0+local.20240222101828) (4.9.0)
2024-02-22 18:18:29 Requirement already satisfied: pytz>=2020.1 in /opt/pysetup/.venv/lib/python3.11/site-packages (from pandas>=2.0.0->taskweaver==0.0.12a0+local.20240222101828) (2024.1)
2024-02-22 18:18:29 Requirement already satisfied: tzdata>=2022.7 in /opt/pysetup/.venv/lib/python3.11/site-packages (from pandas>=2.0.0->taskweaver==0.0.12a0+local.20240222101828) (2024.1)
2024-02-22 18:18:29 Requirement already satisfied: cfgv>=2.0.0 in /opt/pysetup/.venv/lib/python3.11/site-packages (from pre-commit>=2.19.0->taskweaver==0.0.12a0+local.20240222101828) (3.4.0)
2024-02-22 18:18:29 Requirement already satisfied: identify>=1.0.0 in /opt/pysetup/.venv/lib/python3.11/site-packages (from pre-commit>=2.19.0->taskweaver==0.0.12a0+local.20240222101828) (2.5.35)
2024-02-22 18:18:29 Requirement already satisfied: nodeenv>=0.11.1 in /opt/pysetup/.venv/lib/python3.11/site-packages (from pre-commit>=2.19.0->taskweaver==0.0.12a0+local.20240222101828) (1.8.0)
2024-02-22 18:18:29 Requirement already satisfied: virtualenv>=20.10.0 in /opt/pysetup/.venv/lib/python3.11/site-packages (from pre-commit>=2.19.0->taskweaver==0.0.12a0+local.20240222101828) (20.25.0)
2024-02-22 18:18:29 Requirement already satisfied: iniconfig in /opt/pysetup/.venv/lib/python3.11/site-packages (from pytest>=7.0.0->taskweaver==0.0.12a0+local.20240222101828) (2.0.0)
2024-02-22 18:18:29 Requirement already satisfied: pluggy<2.0,>=1.3.0 in /opt/pysetup/.venv/lib/python3.11/site-packages (from pytest>=7.0.0->taskweaver==0.0.12a0+local.20240222101828) (1.4.0)
2024-02-22 18:18:29 Requirement already satisfied: charset-normalizer<4,>=2 in /opt/pysetup/.venv/lib/python3.11/site-packages (from requests>=2.31.0->taskweaver==0.0.12a0+local.20240222101828) (3.3.2)
2024-02-22 18:18:29 Requirement already satisfied: idna<4,>=2.5 in /opt/pysetup/.venv/lib/python3.11/site-packages (from requests>=2.31.0->taskweaver==0.0.12a0+local.20240222101828) (3.6)
2024-02-22 18:18:29 Requirement already satisfied: certifi>=2017.4.17 in /opt/pysetup/.venv/lib/python3.11/site-packages (from requests>=2.31.0->taskweaver==0.0.12a0+local.20240222101828) (2024.2.2)
2024-02-22 18:18:29 Requirement already satisfied: scipy>=1.6.0 in /opt/pysetup/.venv/lib/python3.11/site-packages (from scikit-learn>=1.2.2->taskweaver==0.0.12a0+local.20240222101828) (1.12.0)
2024-02-22 18:18:29 Requirement already satisfied: joblib>=1.2.0 in /opt/pysetup/.venv/lib/python3.11/site-packages (from scikit-learn>=1.2.2->taskweaver==0.0.12a0+local.20240222101828) (1.3.2)
2024-02-22 18:18:29 Requirement already satisfied: threadpoolctl>=2.0.0 in /opt/pysetup/.venv/lib/python3.11/site-packages (from scikit-learn>=1.2.2->taskweaver==0.0.12a0+local.20240222101828) (3.3.0)
2024-02-22 18:18:29 Requirement already satisfied: wrapt in /opt/pysetup/.venv/lib/python3.11/site-packages (from vcrpy>=5.0.0->taskweaver==0.0.12a0+local.20240222101828) (1.16.0)
2024-02-22 18:18:29 Requirement already satisfied: yarl in /opt/pysetup/.venv/lib/python3.11/site-packages (from vcrpy>=5.0.0->taskweaver==0.0.12a0+local.20240222101828) (1.9.4)
2024-02-22 18:18:30 Requirement already satisfied: httpcore<0.18.0,>=0.15.0 in /opt/pysetup/.venv/lib/python3.11/site-packages (from httpx<1,>=0.23.0->openai>=1.2.4->taskweaver==0.0.12a0+local.20240222101828) (0.17.3)
2024-02-22 18:18:30 Requirement already satisfied: decorator in /opt/pysetup/.venv/lib/python3.11/site-packages (from ipython>=7.23.1->ipykernel==6.26.0->taskweaver==0.0.12a0+local.20240222101828) (5.1.1)
2024-02-22 18:18:30 Requirement already satisfied: jedi>=0.16 in /opt/pysetup/.venv/lib/python3.11/site-packages (from ipython>=7.23.1->ipykernel==6.26.0->taskweaver==0.0.12a0+local.20240222101828) (0.19.1)
2024-02-22 18:18:30 Requirement already satisfied: prompt-toolkit<3.1.0,>=3.0.41 in /opt/pysetup/.venv/lib/python3.11/site-packages (from ipython>=7.23.1->ipykernel==6.26.0->taskweaver==0.0.12a0+local.20240222101828) (3.0.43)
2024-02-22 18:18:30 Requirement already satisfied: pygments>=2.4.0 in /opt/pysetup/.venv/lib/python3.11/site-packages (from ipython>=7.23.1->ipykernel==6.26.0->taskweaver==0.0.12a0+local.20240222101828) (2.17.2)
2024-02-22 18:18:30 Requirement already satisfied: stack-data in /opt/pysetup/.venv/lib/python3.11/site-packages (from ipython>=7.23.1->ipykernel==6.26.0->taskweaver==0.0.12a0+local.20240222101828) (0.6.3)
2024-02-22 18:18:30 Requirement already satisfied: pexpect>4.3 in /opt/pysetup/.venv/lib/python3.11/site-packages (from ipython>=7.23.1->ipykernel==6.26.0->taskweaver==0.0.12a0+local.20240222101828) (4.9.0)
2024-02-22 18:18:30 Requirement already satisfied: platformdirs>=2.5 in /opt/pysetup/.venv/lib/python3.11/site-packages (from jupyter-core!=5.0.*,>=4.12->ipykernel==6.26.0->taskweaver==0.0.12a0+local.20240222101828) (3.11.0)
2024-02-22 18:18:30 Requirement already satisfied: setuptools in /opt/pysetup/.venv/lib/python3.11/site-packages (from nodeenv>=0.11.1->pre-commit>=2.19.0->taskweaver==0.0.12a0+local.20240222101828) (69.1.0)
2024-02-22 18:18:30 Requirement already satisfied: annotated-types>=0.4.0 in /opt/pysetup/.venv/lib/python3.11/site-packages (from pydantic<3,>=1.9.0->openai>=1.2.4->taskweaver==0.0.12a0+local.20240222101828) (0.6.0)
2024-02-22 18:18:30 Requirement already satisfied: pydantic-core==2.16.2 in /opt/pysetup/.venv/lib/python3.11/site-packages (from pydantic<3,>=1.9.0->openai>=1.2.4->taskweaver==0.0.12a0+local.20240222101828) (2.16.2)
2024-02-22 18:18:31 Requirement already satisfied: six>=1.5 in /opt/pysetup/.venv/lib/python3.11/site-packages (from python-dateutil>=2.7->matplotlib>=3.4->taskweaver==0.0.12a0+local.20240222101828) (1.16.0)
2024-02-22 18:18:32 Requirement already satisfied: distlib<1,>=0.3.7 in /opt/pysetup/.venv/lib/python3.11/site-packages (from virtualenv>=20.10.0->pre-commit>=2.19.0->taskweaver==0.0.12a0+local.20240222101828) (0.3.8)
2024-02-22 18:18:32 Requirement already satisfied: filelock<4,>=3.12.2 in /opt/pysetup/.venv/lib/python3.11/site-packages (from virtualenv>=20.10.0->pre-commit>=2.19.0->taskweaver==0.0.12a0+local.20240222101828) (3.13.1)
2024-02-22 18:18:33 Requirement already satisfied: multidict>=4.0 in /opt/pysetup/.venv/lib/python3.11/site-packages (from yarl->vcrpy>=5.0.0->taskweaver==0.0.12a0+local.20240222101828) (6.0.5)
2024-02-22 18:18:33 Requirement already satisfied: h11<0.15,>=0.13 in /opt/pysetup/.venv/lib/python3.11/site-packages (from httpcore<0.18.0,>=0.15.0->httpx<1,>=0.23.0->openai>=1.2.4->taskweaver==0.0.12a0+local.20240222101828) (0.14.0)
2024-02-22 18:18:33 Requirement already satisfied: parso<0.9.0,>=0.8.3 in /opt/pysetup/.venv/lib/python3.11/site-packages (from jedi>=0.16->ipython>=7.23.1->ipykernel==6.26.0->taskweaver==0.0.12a0+local.20240222101828) (0.8.3)
2024-02-22 18:18:33 Requirement already satisfied: ptyprocess>=0.5 in /opt/pysetup/.venv/lib/python3.11/site-packages (from pexpect>4.3->ipython>=7.23.1->ipykernel==6.26.0->taskweaver==0.0.12a0+local.20240222101828) (0.7.0)
2024-02-22 18:18:34 Requirement already satisfied: wcwidth in /opt/pysetup/.venv/lib/python3.11/site-packages (from prompt-toolkit<3.1.0,>=3.0.41->ipython>=7.23.1->ipykernel==6.26.0->taskweaver==0.0.12a0+local.20240222101828) (0.2.13)
2024-02-22 18:18:34 Requirement already satisfied: executing>=1.2.0 in /opt/pysetup/.venv/lib/python3.11/site-packages (from stack-data->ipython>=7.23.1->ipykernel==6.26.0->taskweaver==0.0.12a0+local.20240222101828) (2.0.1)
2024-02-22 18:18:34 Requirement already satisfied: asttokens>=2.1.0 in /opt/pysetup/.venv/lib/python3.11/site-packages (from stack-data->ipython>=7.23.1->ipykernel==6.26.0->taskweaver==0.0.12a0+local.20240222101828) (2.4.1)
2024-02-22 18:18:34 Requirement already satisfied: pure-eval in /opt/pysetup/.venv/lib/python3.11/site-packages (from stack-data->ipython>=7.23.1->ipykernel==6.26.0->taskweaver==0.0.12a0+local.20240222101828) (0.2.2)
2024-02-22 18:18:36 Installing collected packages: taskweaver
2024-02-22 18:18:36   Running setup.py develop for taskweaver
2024-02-22 18:18:37 Successfully installed taskweaver-0.0.12a0+local.20240222101836 # See that it is installed here
2024-02-22 18:18:37 Traceback (most recent call last):
2024-02-22 18:18:37   File "/app/app.py", line 15, in <module>
2024-02-22 18:18:37     import taskweaver
2024-02-22 18:18:37 ModuleNotFoundError: No module named 'taskweaver'
liqul commented 6 months ago

One suggestion would be get into your container and check what is wrong with the environment with, e.g., "docker run -ti image_name bash"

KawniX commented 6 months ago

I got taskweaver to show. Now my issue is that

2024-02-25 03:48:09   File "/home/user/.local/bin/chainlit", line 8, in <module>
2024-02-25 03:48:09     sys.exit(cli())
2024-02-25 03:48:09              ^^^^^
2024-02-25 03:48:09   File "/home/user/.local/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
2024-02-25 03:48:09     return self.main(*args, **kwargs)
2024-02-25 03:48:09            ^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-02-25 03:48:09   File "/home/user/.local/lib/python3.11/site-packages/click/core.py", line 1078, in main
2024-02-25 03:48:09     rv = self.invoke(ctx)
2024-02-25 03:48:09          ^^^^^^^^^^^^^^^^
2024-02-25 03:48:09   File "/home/user/.local/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
2024-02-25 03:48:09     return _process_result(sub_ctx.command.invoke(sub_ctx))
2024-02-25 03:48:09                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-02-25 03:48:09   File "/home/user/.local/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
2024-02-25 03:48:09     return ctx.invoke(self.callback, **ctx.params)
2024-02-25 03:48:09            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-02-25 03:48:09   File "/home/user/.local/lib/python3.11/site-packages/click/core.py", line 783, in invoke
2024-02-25 03:48:09     return __callback(*args, **kwargs)
2024-02-25 03:48:09            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-02-25 03:48:09   File "/home/user/.local/lib/python3.11/site-packages/chainlit/cli/__init__.py", line 153, in chainlit_run
2024-02-25 03:48:09     run_chainlit(target)
2024-02-25 03:48:09   File "/home/user/.local/lib/python3.11/site-packages/chainlit/cli/__init__.py", line 55, in run_chainlit
2024-02-25 03:48:09     load_module(config.run.module_name)
2024-02-25 03:48:09   File "/home/user/.local/lib/python3.11/site-packages/chainlit/config.py", line 337, in load_module
2024-02-25 03:48:09     spec.loader.exec_module(module)
2024-02-25 03:48:09   File "<frozen importlib._bootstrap_external>", line 940, in exec_module
2024-02-25 03:48:09   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
2024-02-25 03:48:09   File "/home/user/app/app.py", line 34, in <module>
2024-02-25 03:48:09     from taskweaver.app.app import TaskWeaverApp
2024-02-25 03:48:09   File "/home/user/.local/lib/python3.11/site-packages/taskweaver/app/__init__.py", line 1, in <module>
2024-02-25 03:48:09     from .app import TaskWeaverApp
2024-02-25 03:48:09   File "/home/user/.local/lib/python3.11/site-packages/taskweaver/app/app.py", line 8, in <module>
2024-02-25 03:48:09     from taskweaver.memory.plugin import PluginModule
2024-02-25 03:48:09   File "/home/user/.local/lib/python3.11/site-packages/taskweaver/memory/__init__.py", line 5, in <module>
2024-02-25 03:48:09     from .memory import Memory
2024-02-25 03:48:09   File "/home/user/.local/lib/python3.11/site-packages/taskweaver/memory/memory.py", line 11, in <module>
2024-02-25 03:48:09     from taskweaver.module.prompt_util import PromptUtil
2024-02-25 03:48:09 ModuleNotFoundError: No module named 'taskweaver.module'

I think taskweaver.module is missing a init.py no? Please check

liqul commented 6 months ago

Did you install taskweaver at your local host? e.g., by pip install -e TaskWeaver?

I didn't pack a container but I just tried install it in a clean local environment. I can successfully run in command line mode or using chainlit. So, I don't think missing init.py caused this issue.

Could you also try install taskweaver locally and check if you can run it successfully before packing the container?

joseza-idb commented 6 months ago

Hey @KawniX , did you managed to get it worked? I got the same issue as you: ModuleNotFoundError: No module named 'taskweaver.module'. But i solved by adding this to my dockerfile:

ENV PYTHONPATH /TaskWeaver

added this after installing chainlit and before WORKDIR /TaskWeaver/playground/UI

liqul commented 6 months ago

Hey @KawniX , did you managed to get it worked? I got the same issue as you: ModuleNotFoundError: No module named 'taskweaver.module'. But i solved by adding this to my dockerfile:

ENV PYTHONPATH /TaskWeaver

added this after installing chainlit and before WORKDIR /TaskWeaver/playground/UI

Thanks for the information! By adding TaskWeaver to PYTHONPATH, you actually let the python interpreter know where the taskweaver module is located. This behaves similarly to installing the module using pip.