-1

我是 python 新手,我正在尝试运行监视系统上特定文件夹以跟踪事件的监视程序代码。但是,我在以下几行中不断收到错误(“未解决的导入”):

from watchdog.events import FileSystemEventHandler  
from watchdog.observers import Observer

我已经正确安装了看门狗。但是,我想知道我是否应该在系统路径中包含或对环境变量进行一些更改,或者在 Eclipse 的 pydev 项目中的 pythonpath 中包含一些外部库。

下面给出了使用这些导入的代码:

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"

是否会因为“观察者”导入在上课之前而“如果”在程序结束时出现问题?有人请帮我解决这个问题。

4

1 回答 1

0

请确保您在 PyDev 中使用的 Python 解释器与用于安装watchdog. (请参阅PyDev - 解释器配置

于 2014-09-13T18:38:17.440 回答