Watchdog: ModuleNotFoundError: No module named 'watchdog'

Created on 8 Sep 2020  路  6Comments  路  Source: gorakhargosh/watchdog

I just installed the package on an Anaconda virtual env using the command line:
pip install watchdog
and when I try to run:
from watchdog.observers import Observer
I get an import error:
ModuleNotFoundError: No module named 'watchdog'

(venv) C:\Users\user>pip list
certifi: 2020.6.20
pathtools: 0.1.2
pip: 20.2.2
setuptools: 49.6.0.post20200814
watchdog: 0.10.3
wheel: 0.35.1
wincertstore: 0.2

Python version: 3.8.5

OS: Windows 10

not a bug

Most helpful comment

Check that you do not have a file named watchdog.py not a folder name watchdog.

All 6 comments

If you use python -m pip install watchdog, it should work.

I'm having the same issue here, installed and uninstalled several times with the same error.

ModuleNotFoundError: No module named 'watchdog.observers'; 'watchdog' is not a package

@JeromeHoen cannot reproduce this on fresh installed Anaconda. Only difference (that no sence) is that I'm using Windows 7:

(base) C:\Users\User>python
Python 3.8.3 (default, Jul  2 2020, 17:30:36) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from watchdog.observers import Observer
>>>

I not think that this issue is related to the watchdog itself. Maybe watchdog package installed in one virtual environment and you trying to import it working in another virtual environment?

I'm having the issue as well. Similar to @JeromeHoen I'm running Win10, but this time no virtual environment. I can do from watchdog.observers import Observer in IDLE, but when I'm (trying) to run it as part of a script, it fails.

Check that you do not have a file named watchdog.py not a folder name watchdog.

Thanks, @BoboTiG, that was my issue and I found it just before coming back here to comment on my own silliness 馃槃

Was this page helpful?
0 / 5 - 0 ratings