Reputation: 29
I am new to python, and I'm trying to run my watchdog code that monitors a particular folder on my system to track events. However, I keep getting an error ("Unresolved import") in the following lines :
from watchdog.events import FileSystemEventHandler
from watchdog.observers import Observer
I have installed watchdog properly. However, I would like to know if I'm supposed include or make some changes to the environment variables in the system's path or include some external libraries in the pythonpath in my pydev project in eclipse.
The code that uses these imports is given below:
import dropbox
...
from watchdog.events import FileSystemEventHandler
from watchdog.observers import Observer
class MyHandler(FileSystemEventHandler):
def eveny_any(self,event):
...
def dropfn(self,fn)
...
#dropbpx (big) code
if _name_="_main_":
# here I used "watchdog observer"
Will it be a problem because the "observer" import is before class and "if" is towards the end of the program? Someone please help me to resolve this issue.
Upvotes: 0
Views: 3178
Reputation: 369394
Mkae sure that you're using the same Python interpreter in PyDev with the Python used to install watchdog
. (See PyDev - Interpreter Configuration)
Upvotes: 1