Stuck in Dev Guide - Modules are not resolved after installing and running the docker build

I have followed the readme exactly and after concluding the steps in Docker Installation the required modules to run the bot, as suggested in the next step of the tutorial, are not resolve in my python file. I have tried and tried to troubleshoot, changed to individual RUN pip install “name of the module” in the dockerfile as recommended in a git topic for a similar issue but no matter how often I build this docker bs (i am obviously wound up by now, thanks for bearing with me) i cannot figure it out.

(pyAI) Philipp@MacBook-Pro ottomator-agents % cd base_python_docker
(pyAI) Philipp@MacBook-Pro base_python_docker % docker build -t ottomator/base-python:latest . 
[+] Building 39.9s (15/15) FINISHED                                                  docker:desktop-linux
 => [internal] load build definition from Dockerfile                                                 0.0s
 => => transferring dockerfile: 537B                                                                 0.0s
 => [internal] load metadata for docker.io/library/python:3.11-slim                                  1.7s
 => [auth] library/python:pull token for registry-1.docker.io                                        0.0s
 => [internal] load .dockerignore                                                                    0.0s
 => => transferring context: 2B                                                                      0.0s
 => [ 1/10] FROM docker.io/library/python:3.11-slim@sha256:873952659a04188d2a62d5f7e30fd673d2559432  0.0s
 => CACHED [ 2/10] WORKDIR /app                                                                      0.0s
 => [ 3/10] RUN pip install fastapi                                                                  5.9s
 => [ 4/10] RUN pip install uvicorn                                                                  1.7s 
 => [ 5/10] RUN pip install pydantic                                                                 0.3s 
 => [ 6/10] RUN pip install supabase                                                                12.7s 
 => [ 7/10] RUN pip install python-dotenv                                                            1.4s 
 => [ 8/10] RUN pip install asyncpg                                                                  1.8s 
 => [ 9/10] RUN pip install pandas                                                                  13.6s 
 => [10/10] RUN useradd -m appuser && chown -R appuser:appuser /app                                  0.1s
 => exporting to image                                                                               0.4s
 => => exporting layers                                                                              0.4s
 => => writing image sha256:cdf2c94c7261be81dfcb4308e7f018795142cd3eadb81deae0ee528ba99ef9f4         0.0s
 => => naming to docker.io/ottomator/base-python:latest                                              0.0s
(pyAI) Philipp@MacBook-Pro base_python_docker % cd ../~sample-python-agent~
(pyAI) Philipp@MacBook-Pro ~sample-python-agent~ % docker build -t sample-python-agent . 
[+] Building 5.3s (15/15) FINISHED                                                   docker:desktop-linux
 => [internal] load build definition from Dockerfile                                                 0.0s
 => => transferring dockerfile: 515B                                                                 0.0s
 => [internal] load metadata for docker.io/ottomator/base-python:latest                              0.0s
 => [internal] load .dockerignore                                                                    0.0s
 => => transferring context: 2B                                                                      0.0s
 => [ 1/10] FROM docker.io/ottomator/base-python:latest                                              0.1s
 => [internal] load build context                                                                    2.5s
 => => transferring context: 121.77MB                                                                2.5s
 => [ 2/10] WORKDIR /app                                                                             0.0s
 => [ 3/10] RUN pip install fastapi                                                                  1.0s
 => [ 4/10] RUN pip install uvicorn                                                                  0.6s
 => [ 5/10] RUN pip install pydantic                                                                 0.9s 
 => [ 6/10] RUN pip install supabase                                                                 0.5s 
 => [ 7/10] RUN pip install python-dotenv                                                            0.4s 
 => [ 8/10] RUN pip install asyncpg                                                                  0.4s 
 => [ 9/10] RUN pip install pandas                                                                   0.4s
 => [10/10] COPY . .                                                                                 0.4s
 => exporting to image                                                                               0.4s
 => => exporting layers                                                                              0.4s
 => => writing image sha256:907854a8105416aaea7efed1755354113fede52a58fad12525c8358ea09a4019         0.0s
 => => naming to docker.io/library/sample-python-agent                                               0.0s
(pyAI) Philipp@MacBook-Pro ~sample-python-agent~ % docker run -d --name sample-python-agent -p 8001:8001 --env-file .env sample-python-agent 
docker: Error response from daemon: Conflict. The container name "/sample-python-agent" is already in use by container "9c5c99c544e0083cd8a1e4c7ee03a0120046524daf46505c833c27c57345153f". You have to remove (or rename) that container to be able to reuse that name.
See 'docker run --help'.
(pyAI) Philipp@MacBook-Pro ~sample-python-agent~ % docker rm sample-python-agent
sample-python-agent
(pyAI) Philipp@MacBook-Pro ~sample-python-agent~ % docker run -d --name sample-python-agent -p 8001:8001 --env-file .env sample-python-agent
ea72f14cce9435052b6f76d1e2f2dda2792c6646dd8b1c71ec535071a8a2cd59
(pyAI) Philipp@MacBook-Pro ~sample-python-agent~ % docker build -t sample-python-agent .
[+] Building 0.4s (15/15) FINISHED                                                   docker:desktop-linux
 => [internal] load build definition from Dockerfile                                                 0.0s
 => => transferring dockerfile: 515B                                                                 0.0s
 => [internal] load metadata for docker.io/ottomator/base-python:latest                              0.0s
 => [internal] load .dockerignore                                                                    0.0s
 => => transferring context: 2B                                                                      0.0s
 => [ 1/10] FROM docker.io/ottomator/base-python:latest                                              0.0s
 => [internal] load build context                                                                    0.4s
 => => transferring context: 848.38kB                                                                0.3s
 => CACHED [ 2/10] WORKDIR /app                                                                      0.0s
 => CACHED [ 3/10] RUN pip install fastapi                                                           0.0s
 => CACHED [ 4/10] RUN pip install uvicorn                                                           0.0s
 => CACHED [ 5/10] RUN pip install pydantic                                                          0.0s
 => CACHED [ 6/10] RUN pip install supabase                                                          0.0s
 => CACHED [ 7/10] RUN pip install python-dotenv                                                     0.0s
 => CACHED [ 8/10] RUN pip install asyncpg                                                           0.0s
 => CACHED [ 9/10] RUN pip install pandas                                                            0.0s
 => CACHED [10/10] COPY . .                                                                          0.0s
 => exporting to image                                                                               0.0s
 => => exporting layers                                                                              0.0s
 => => writing image sha256:907854a8105416aaea7efed1755354113fede52a58fad12525c8358ea09a4019         0.0s
 => => naming to docker.io/library/sample-python-agent                                               0.0s
(pyAI) Philipp@MacBook-Pro ~sample-python-agent~ % docker run -it sample-python-agent pip list
Package           Version
----------------- -----------
aiohappyeyeballs  2.4.4
aiohttp           3.11.11
aiosignal         1.3.2
annotated-types   0.7.0
anyio             4.8.0
asyncpg           0.30.0
attrs             24.3.0
certifi           2024.12.14
click             8.1.8
deprecation       2.1.0
fastapi           0.115.6
frozenlist        1.5.0
gotrue            2.11.1
h11               0.14.0
h2                4.1.0
hpack             4.0.0
httpcore          1.0.7
httpx             0.27.2
hyperframe        6.0.1
idna              3.10
multidict         6.1.0
numpy             2.2.1
packaging         24.2
pandas            2.2.3
pip               24.0
postgrest         0.19.1
propcache         0.2.1
pydantic          2.10.5
pydantic_core     2.27.2
python-dateutil   2.9.0.post0
python-dotenv     1.0.1
pytz              2024.2
realtime          2.1.0
setuptools        65.5.1
six               1.17.0
sniffio           1.3.1
starlette         0.41.3
storage3          0.11.0
StrEnum           0.4.15
supabase          2.11.0
supafunc          0.9.0
typing_extensions 4.12.2
tzdata            2024.2
uvicorn           0.34.0
websockets        13.1
wheel             0.45.1
yarl              1.18.3

This is the output after following the steps.
And below the unresolved modules. I really appreciate any help so I can actually start building something. Thank you for you time, whoever takes it.


l

1 Like

This actually should be okay!

Your IDE instance is outside of the container which is why it thinks those modules are not found. But once you actually run everything inside the container those libraries will be there!

1 Like

Thanks for the little nudge there. Turns out it is running. First time using Docker, got really confused.
:pray: Appreciate the help! And been loving your content, keep it up man!

1 Like

Perfect! And you are so welcome - thank you!

Hey Cole, struggling out here. Bear in mind I am learning this as I go.
Here’s the repo and with it the error description in the readme.
TL;DR Agent doesn’t reply in front end in spite of replying in the database.
Haven’t prompted my way out of it. Been going in circles for 7hours.
Thanks a bunch!

Here’s the repo: GitHub - AsanteNuru/agent-watson

1 Like

Glad to hear the messages are showing up in the table at least! That makes me think there is a permission issue for the table and that’s why Agent 0 can’t connect.

Make sure:

  • You enabled realtime for your messages table
  • The table is called messages
  • You don’t have RLS enabled or blocking the frontend from reading it

Also if you refresh the page do you see the conversations and message in Agent 0? That would mean realtime just needs to be set for the messages table!