Caleb
Caleb

Reputation: 489

ModuleNotFoundError: No module named 'watchdog'

I just installed watchdog in the command prompt using pip install watchdog.I uninstalled and reinstalled using python pip -m install watchdog. Neither of these is getting watchdog to work as I keep getting this error: ModuleNotFoundError: No module named 'watchdog'

not sure if me using sublime text 3 is what is affecting this. Please help Here is my code:

from watchdog.observers import observer
from watchdog.events import FileSystemEvenHandler

import os
import json
import time

Upvotes: 4

Views: 12798

Answers (2)

Abdul Rahman Fares
Abdul Rahman Fares

Reputation: 1

Check your python interpreter version, "ModuleNotFoundError: No module named 'watchdog'" resolved for me after I changed the python interpreter version greater than 3.11. In VS Code, you can change the python interpreter version, by following the path view -> Command Palette -> Python: Select Interpreter -> Choose interpreter version greater than or equal to 3.11.

Upvotes: 0

Mohammad Reza
Mohammad Reza

Reputation: 66

This is a duplicate issue. In summary, 1. It may be a python version inconsistency: * If you use python command, execute this command:

python -m pip install watchdog
  • If you use python3 command, execute this command:
python3 -m pip install watchdog
  • If all didn't solved problem, reinstall module.
python -m pip install watchdog
python -m pip uninstall watchdog

or

python3 -m pip install watchdog
python3 -m pip uninstall watchdog

installing module with python -m pip install is preferred to pip install.

Upvotes: 3

Related Questions