Skip to content

watchfiles fails to work on Debian-12 + python-3.11 #346

Description

@RomanPerekhrest

Description

I constantly see the error

Aug 06 12:13:25 :   File ".venv/lib/python3.11/site-packages/watchfiles/main.py", line 126, in watch
Aug 06 12:13:25 :     with RustNotify(
Aug 06 12:13:25 :          ^^^^^^^^^^^
Aug 06 12:13:25 : FileNotFoundError: No such file or directory
Aug 06 12:13:25  }

wich does not allow to use this watcher.
What I've tried (and all that does not help):

  1. rust_timeout=1, yield_on_timeout=True
cd /opt/my-service/
 source .venv/bin/activate
uv cache clean watchfiles
sudo uv pip install --force-reinstall --no-cache-dir watchfiles
  1. uninstall + reinstall.
  2. upgrage from 1.0.4 to 1.1.0

I'm not allowed to install rustc into the system, moreover - strict dependency on rust - is considered (reacted) as a drawback of watchfiles package (I hear the critics).
With all that, It works! on Debian-11 + python-3.9, but that's not the case that is expected for further usage.
Is there a chance for watchfiles in such case, or should I switch to another watcher (if needed urgently) ?

Example Code

from watchfiles import watch, Change
import traceback

...
    def watch(self):
        try:
            for changes in watch(*self._paths, watch_filter=self.on_change, rust_timeout=1, yield_on_timeout=True,
                                 recursive=False, force_polling=True):
                event, path = changes.pop()
                ...
        except Exception as ex:
            logger.warning(str(ex) + traceback.format_exc())

Watchfiles Output

Aug 06 12:13:25 :   File ".venv/lib/python3.11/site-packages/watchfiles/main.py", line 126, in watch
Aug 06 12:13:25 :     with RustNotify(
Aug 06 12:13:25 :          ^^^^^^^^^^^
Aug 06 12:13:25 : FileNotFoundError: No such file or directory
Aug 06 12:13:25  }

Operating System & Architecture

Linux-6.6.62-current-x86-x86_64-with-glibc2.36
#2 SMP PREEMPT_DYNAMIC Sun Nov 17 14:08:59 UTC 2024

Environment

python virtualenv

Python & Watchfiles Version

python: 3.11.2 (main, Apr 28 2025, 14:11:48) [GCC 12.2.0], watchfiles: 1.1.0

Rust & Cargo Version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions