aziz / SublimeFileBrowser

Ditch sidebar and browse your files in a normal tab with keyboard, like a pro!
MIT License
395 stars 45 forks source link

watchdog not importable #144

Closed bbassett closed 6 years ago

bbassett commented 6 years ago

I recently started receiving this error:

FileBrowser:

watchdog module is not importable, hence we cannot know about changes on file system, and auto-refresh will not work.

Despite that, FileBrowser is fully usable without auto-refresh, you can just ignore this message and manually refresh view with r key.

But if you want working auto-refresh:
 • if you install manually, then look at Readme how to install it,
 • if you install via Package Control, report an issue.

I had FileBrowser installed with Package Control initially, so i tried to re-install it from Package Control again and it can't be found. I tried installing it manually according to the README and then i got an error saying dired index is empty, this should never happen, there is a bug

running ST3 Build 3143, on Ubuntu 17.10

bbassett commented 6 years ago

not being able to find FileBrowser in the package control list was my own issue, I've sorted that out, but whne i re-install i still get the same errors otherwise

bbassett commented 6 years ago

I've done some more troubleshooting. i re-installed ST3, installed package control and FileBrowser only and it worked fine, until i either close & re-open FileBrowser or close & re-open ST3. Also, the FileBrowser folder from ~/.config/sublime-text-3/Packages does not exist, and cloning the repo to that location doesn't change anything

vovkkk commented 6 years ago

Is there any error if you execute this in console

import package_events; from watchdog.observers import Observer; from watchdog.events import FileSystemEventHandler
bbassett commented 6 years ago
>>> import package_events; from watchdog.observers import Observer; from watchdog.events import FileSystemEventHandler
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named 'watchdog.observers'
vovkkk commented 6 years ago

What if you execute import watchdog?

Is there directory ~/.config/sublime-text-3/Packages/watchdog? If not; is there any error in console if run Package Control: Satisfy Dependencies in the command palette?

Which distro you use? nvm Ubuntu 17.10

bbassett commented 6 years ago

this is what i got:

Traceback (most recent call last):
  File "/opt/sublime_text/sublime_plugin.py", line 993, in run_
    return self.run(edit, **args)
  File "dired in /home/brandon/.config/sublime-text-3/Installed Packages/FileBrowser.sublime-package", line 187, in run
  File "common in /home/brandon/.config/sublime-text-3/Installed Packages/FileBrowser.sublime-package", line 170, in emit_event
AttributeError: 'module' object has no attribute 'notify'
Traceback (most recent call last):
  File "/opt/sublime_text/sublime_plugin.py", line 993, in run_
    return self.run(edit, **args)
  File "dired in /home/brandon/.config/sublime-text-3/Installed Packages/FileBrowser.sublime-package", line 187, in run
  File "common in /home/brandon/.config/sublime-text-3/Installed Packages/FileBrowser.sublime-package", line 170, in emit_event
AttributeError: 'module' object has no attribute 'notify'
error: FileBrowser:

"dired_index" is empty,
that shouldn’t happen ever, there is some bug.
Traceback (most recent call last):
  File "/opt/sublime_text/sublime_plugin.py", line 993, in run_
    return self.run(edit, **args)
  File "dired in /home/brandon/.config/sublime-text-3/Installed Packages/FileBrowser.sublime-package", line 405, in run
  File "dired in /home/brandon/.config/sublime-text-3/Installed Packages/FileBrowser.sublime-package", line 426, in goto_directory
TypeError: 'NoneType' object is not subscriptable

Yes i have the ~/.config/sublime-text-3/Packages/watchdog

and just for good measure i ran Satisfy Dependencies and the logged response was Package Control: All dependencies have been satisfied

bbassett commented 6 years ago

also, what's weird is i don't have a ~/.config/sublime-text-3/Packages/FileBrowser directory

vovkkk commented 6 years ago

When you install via PC it is placed as a zipball in Intalled Packages/FileBrowser.sublime-package; if it is already installed you cannot install it again without removing it first, PC won’t show installed packages in the list for installation; you shouldnot try to install it manually if it is already via PC;

When you have 'module' object has no attribute but the module itself is importable (package_events in this case, and the same with watchdog.observers—AFAIU import watchdog does not raise any errors, right?) means module was not loaded properly, usually you can fix it by relaunching ST. So if you still have those errors, make sure that there are no any remains from manual installation (i.e. Packages/FileBrowser), and exit ST.

installed package control and FileBrowser only and it worked fine, until i either close & re-open FileBrowser or close & re-open ST3

I’ve tested it on Ubuntu, I tried to close, re-open—everything works without errors including auto-refresh itself. Did you do anything else before the error started popping?

bbassett commented 6 years ago

Thanks for testing it on Ubuntu and being responsive. I hadn't really changed much on my system before seeing the error, It did go through some system updates, but that's about it. I re-installed sublime from scratch, installed PC and FileBrowser and now everything works normally with no errors, including after closing/re-opening bot ST3 and FileBrowser.

So who knows what caused the issue. I have changed nothing to fix the error, but it's working now.

Again, thanks for being responsive, and for all your work on this package, it's amazing!