GregDMeyer / IT8951

Driver for the IT8951 e-paper controller on Raspberry Pi
MIT License
155 stars 55 forks source link

add tkinter to requirements #11

Closed mankyd closed 4 years ago

mankyd commented 4 years ago

display.py imports tkinter:

import tkinter as tk

It should be added to requirements.txt

mankyd commented 4 years ago

Actually, after some more investigation, the solution for getting it working my virtual-env was simply:

sudo apt install python3-tk
GregDMeyer commented 4 years ago

yeah, tkinter should be included in most python distributions by default, and by my understanding, if it's not, it can't be solved by pip (and thus requirements.txt).

one thing I can do is to move the tk import closer to where it is used, so it isn't imported unnecessarily. that way, most users of the library won't need it, unless they use the specific virtual display functionality.

mankyd commented 4 years ago

Conditional import would be great. Maybe add a line to the readme stating that tkinter should be setup.

Jacob-Bishop commented 4 years ago

Seconding that a line in the readme would be nice. On a fresh raspberry OS install (which I'm guessing is a common use case for this module?), libopen2-7, 'libtiff-5, and python3-dev also needed to be installed via apt.

FutureSharks commented 4 years ago

My preference would be to remove the dependency on tkinter and have a separate requirements.txt for running the tests. I don't really want to install python3-tk and its X11 dependencies when they are only used for the tests 🙂

GregDMeyer commented 4 years ago

OK, with the changes I just merged you should not need tkinter any more unless you are running the tests. Let me know if you find any issue with the change!

Ken-mbira commented 3 years ago

If it was added to the requirements file then maybe you could paste how it looks for us to just paste ourselves.