#13920·appwrite

Guvicorn/Hot Swap Issues in Local Functions Running Python

Author: banddansCreated Sep 26, 2026Updated Sep 26, 2026
Labelsproduct / storageproduct / authproduct / functionssdk / cli

Reproduction steps

I created a test function with appwrite init function, wrote some hello world response and ran it with appwrite run function. The function sucessfully started and responded like it should. Howver it didn't let me save my function.

Expected behavior

I expected it to hot reload successfully.

Actual Behavior

Instead it threw an error about not finding gunicorn like this:

❯ appwrite run function
ℹ Info: Port 3000 is in use, so this function is on 3001.
  runtime:    python-3.14
  entrypoint: src/main.py
  path:       functions/generate-pdf
  commands:   pip install -r requirements.txt
  scopes:     users.read

ℹ Info: If you wish to change your local settings, update the appwrite.config.json file and rerun the 'appwrite run' command.
ℹ Info: Permissions, events, CRON and timeouts don't apply when running locally.
ℹ Info: Verifying Docker image ...
ℹ Info: Building function using Docker ...
[14:34:09] [open-runtimes] Build cache miss.
[14:34:09] [open-runtimes] Environment preparation started.
[14:34:11] [open-runtimes] Environment preparation finished.
[14:34:11] [open-runtimes] Build command execution started.
Collecting appwrite (from -r requirements.txt (line 1))
  Downloading appwrite-24.0.0-py3-none-any.whl.metadata (7.9 kB)
Collecting requests (from appwrite->-r requirements.txt (line 1))
  Downloading requests-2.34.2-py3-none-any.whl.metadata (4.8 kB)
Collecting pydantic<3,>=2 (from appwrite->-r requirements.txt (line 1))
  Downloading pydantic-2.13.5-py3-none-any.whl.metadata (110 kB)
Collecting annotated-types>=0.6.0 (from pydantic<3,>=2->appwrite->-r requirements.txt (line 1))
  Downloading annotated_types-0.8.0-py3-none-any.whl.metadata (15 kB)
Collecting pydantic-core==2.46.5 (from pydantic<3,>=2->appwrite->-r requirements.txt (line 1))
  Downloading pydantic_core-2.46.5-cp314-cp314-musllinux_1_1_aarch64.whl.metadata (6.6 kB)
Collecting typing-extensions>=4.14.1 (from pydantic<3,>=2->appwrite->-r requirements.txt (line 1))
  Downloading typing_extensions-4.16.0-py3-none-any.whl.metadata (3.3 kB)
Collecting typing-inspection>=0.4.2 (from pydantic<3,>=2->appwrite->-r requirements.txt (line 1))
  Downloading typing_inspection-0.4.4-py3-none-any.whl.metadata (2.6 kB)
Collecting charset_normalizer<4,>=2 (from requests->appwrite->-r requirements.txt (line 1))
  Downloading charset_normalizer-3.5.1-cp314-cp314-musllinux_1_2_aarch64.whl.metadata (45 kB)
Collecting idna<4,>=2.5 (from requests->appwrite->-r requirements.txt (line 1))
  Downloading idna-3.20-py3-none-any.whl.metadata (7.2 kB)
Collecting urllib3<3,>=1.26 (from requests->appwrite->-r requirements.txt (line 1))
  Downloading urllib3-2.8.0-py3-none-any.whl.metadata (7.4 kB)
Collecting certifi>=2023.5.7 (from requests->appwrite->-r requirements.txt (line 1))
  Downloading certifi-2026.7.22-py3-none-any.whl.metadata (2.5 kB)
Downloading appwrite-24.0.0-py3-none-any.whl (403 kB)
Downloading pydantic-2.13.5-py3-none-any.whl (472 kB)
Downloading pydantic_core-2.46.5-cp314-cp314-musllinux_1_1_aarch64.whl (2.2 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.2/2.2 MB 12.4 MB/s  0:00:00
Downloading annotated_types-0.8.0-py3-none-any.whl (13 kB)
Downloading typing_extensions-4.16.0-py3-none-any.whl (45 kB)
Downloading typing_inspection-0.4.4-py3-none-any.whl (14 kB)
Downloading requests-2.34.2-py3-none-any.whl (73 kB)
Downloading charset_normalizer-3.5.1-cp314-cp314-musllinux_1_2_aarch64.whl (244 kB)
Downloading idna-3.20-py3-none-any.whl (69 kB)
Downloading urllib3-2.8.0-py3-none-any.whl (135 kB)
Downloading certifi-2026.7.22-py3-none-any.whl (136 kB)
Installing collected packages: urllib3, typing-extensions, idna, charset_normalizer, certifi, annotated-types, typing-inspection, requests, pydantic-core, pydantic, appwrite

Successfully installed annotated-types-0.8.0 appwrite-24.0.0 certifi-2026.7.22 charset_normalizer-3.5.1 idna-3.20 pydantic-2.13.5 pydantic-core-2.46.5 requests-2.34.2 typing-extensions-4.16.0 typing-inspection-0.4.4 urllib3-2.8.0

[notice] A new release of pip is available: 26.1.2 -> 26.2.1
[notice] To update, run: pip install --upgrade pip
[14:34:15] [open-runtimes] Build command execution finished.
[14:34:15] [open-runtimes] Build packaging started.
[14:34:16] [open-runtimes] Build packaging finished.
[14:34:16] [open-runtimes] Build cache saved. (6004736 bytes)
[14:34:16] [open-runtimes] Build finished.

ℹ Info: Starting function using Docker ...
ℹ Info: Function automatically restarts when you edit your code.

[14:34:16] [open-runtimes] Code extraction started.
[14:34:17] [open-runtimes] Code extraction finished.
[14:34:17] [open-runtimes] Environment preparation started.
[14:34:17] [open-runtimes] Environment preparation finished.
[14:34:17] [open-runtimes] Runtime started.
HTTP server successfully started!

✓ Success: Visit http://localhost:3001/ to execute your function.

ℹ Info: Hot-swapping function.. Files with change are src/main.py
[14:34:28] [open-runtimes] Code extraction started.
[14:34:28] [open-runtimes] Code extraction finished.
[14:34:28] [open-runtimes] Environment preparation started.
[14:34:28] [open-runtimes] Environment preparation finished.
[14:34:28] [open-runtimes] Runtime started.
HTTP server successfully started!

I edited main.py to a different hello world messag here and it threw this:

Traceback (most recent call last):
  File "/usr/local/server/server-env/bin/gunicorn", line 3, in <module>
    from gunicorn.app.wsgiapp import run
ModuleNotFoundError: No module named 'gunicorn'
✗ Error: The function stopped running.
✗ Error: the function's container stopped: exit status 1

(and yes, I have a different server on 3000, it's not a bug)

Appwrite version

Appwrite Cloud

Operating system

MacOS

Your Environment

Tried in both the python 3.12 and the 3.14 images, none of them worked. Default appwrite cli version 28.0.0 from homebrew.

Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

Have you read the Code of Conduct?