MA3STR0 / kimsufi-crawler

Crawler that will send you an email alert as soon as servers on OVH/Kimsufi become available for purchase
MIT License
194 stars 62 forks source link

Imported module errors are not shown (easygui) #57

Closed njgray closed 7 years ago

njgray commented 8 years ago

When trying to run with the notifiers option on Ubuntu 15.10 I was getting the error to install easygui:

2016-06-24 09:28:01,372 Notifier loading failed, check config for errors
Traceback (most recent call last):
  File "crawler.py", line 147, in <module>
    NOTIFIER = getattr(_NOTIFIER_MODULE, _NOTIFIER_CLASSNAME)(_CONFIG)
  File "/usr/local/basement/kimsufi-crawler/notifiers/base_notifier.py", line 12, in __init__
    self.check_requirements()
  File "/usr/local/basement/kimsufi-crawler/notifiers/popup_notifier.py", line 19, in check_requirements
    "easygui Python library is required for popup notifications. "
Warning: easygui Python library is required for popup notifications. You can install it by running in terminal:
sudo easy_install easygui

, even though it had been installed via the requirements.txt file. A quick test revealed that easygui was missing a dependency:

Python 2.7.10 (default, Oct 14 2015, 16:09:02) 
[GCC 5.2.1 20151010] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> __import__('easygui');
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/easygui/__init__.py", line 34, in <module>
    from .boxes.button_box import buttonbox
  File "/usr/local/lib/python2.7/dist-packages/easygui/boxes/button_box.py", line 19, in <module>
    import utils as ut
  File "/usr/local/lib/python2.7/dist-packages/easygui/boxes/utils.py", line 43, in <module>
    raise ImportError("Unable to find tkinter package.")
ImportError: Unable to find tkinter package.

Quick fix was to run sudo apt-get install python-tk python3-tk

Not very familiar with Python, but either hoisting imported module errors to crawler.py or having a check for python-tk seems like a good fix. Additionally, since it is very minor and possible an edge case, a simple mention in the README might do just as well.

MA3STR0 commented 7 years ago

thanks, fixed with e65d1f