EDCD / EDMarketConnector

Downloads commodity market and other station data from the game Elite: Dangerous for use with all popular online and offline trading tools.
GNU General Public License v2.0
994 stars 156 forks source link

Running from Source - Watchdog Error #2071

Closed Zang-tu closed 1 year ago

Zang-tu commented 1 year ago

Describe the bug When running from source (in my case updating to newer version), EDMC throws a couple of errors these seem to be due to Watchdog and the fact I don't have it installed. I'm not sure a standard user would require watchdog? (at least they didn't in previous versions). If it is required, steps to install need to be included in wiki maybe?

Errors thrown back: Traceback (most recent call last): File "/home/[install dir]/EDMarketConnector.py", line 439, in from dashboard import dashboard File "/home/[install dir]/dashboard.py", line 12, in from watchdog.observers.api import BaseObserver ModuleNotFoundError: No module named 'watchdog'

To Reproduce

  1. follow instructions on wiki for cloning the .git
  2. run python3 EDMarketConnector.py

Expected behavior Script to run and EDMC to open.

Additional Removing the line "from watchdog.observers.api import BaseObserver" from the dashboard.py file does allow EDMC to run however, I'm not sure if this affects any of the other code as I don't know the code language.

bgol commented 1 year ago

You missed: https://github.com/EDCD/EDMarketConnector/wiki/Running-from-source#use-pip-to-install-application-requirement And I think watchdog is used for file obeserving for some time now.

bgol commented 1 year ago

After some investigation, it's used since 2015 but stubed out for linux (which is easy to miss for a new maintainer).

commit a94cf4cfd9f34f6ff4ec98c00b53fc708483db79
Author: Jonathan Harris <...@...org.uk>
Date:   Tue Nov 24 17:42:18 2015 +0000

    Use watchdog module instead of polling for new log files.
commit 64cbffad1e7e18b2827a08b6eb47673c425d1967
Author: Jonathan Harris <...@...org.uk>
Date:   Mon Nov 30 14:43:16 2015 +0000

    Stub out use of watchdog module on Linux.
Athanasius commented 1 year ago

Note the above is about monitor.py (Journal file monitoring), whereas this actual issue is about dashboard.py (Status.json monitoring).

Indeed the un-gated from watchdog.observers.api import BaseObserver near the top of dashboard.py should instead be moved/duplicated into the darwin and win32 sections just below, as the code for Linux doesn't use watchdog.

However, perhaps investigate if watchdog now works on Linux when the monitored file(s) are on an NFS or CIFS mount. A lot of this sort of thing is from many years ago and hasn't been re-checked since.

Athanasius commented 1 year ago

Oh, and either way properly following the 'run from source' instructions would have indeed avoided the error.

Zang-tu commented 1 year ago

Indeed, it would appear I had missed the dependcies as I was updating from an apparently much older version without watchdog.

Edit: not at my computer to run dependcies but will do so tonight to confirm but I would imagine this will fix the issue.

Zang-tu commented 1 year ago

Confirmed, no bug just me being a fool. Properly following run from source instructions works fine.

Closing due to none issue and user error. Sorry folks!