0

I bought a 2.7inch e-Paper HAT,

I install everything but when I try to run a code I have

Traceback (most recent call last):
  File "demo2.py", line 1, in <module>
    import epd2in7
ImportError: No module named epd2in7

any idea how to fix that? To be fair I have no experience with raspberry hardware (just software) I just would like to display a clock

that the official https://www.waveshare.com/wiki/2.7inch_e-Paper_HAT

I also found a another one https://diyprojects.io/test-waveshare-epaper-eink-2-7-spi-screen-raspberry-pi-python/ but always have this epd2in7 error

  • No module named epd2in7 ... it is software related ... just download and install that module – jsotola Apr 10 '18 at 18:44
1

The epd2in7 module is indeed available from the second tutorial you linked.

They ask you to run the following:

wget https://www.waveshare.com/w/upload/f/f5/2.7inch-e-paper-hat-code.7z

And extract the 7-Zip file with

7za e 2.7inch-e-paper-hat-code.7z

Then go to the raspberrypi/python directory:

cd raspberrypi/python

[Note: there is a typo in the tutorial as it asks you to cd /raspberrypi/python; if you did this, you would end up in a non-existent directory because of the leading / pointing to the root of the file system]

If you list the files in raspberrypi/python with ls, you should notice an epd2in7.py file among others. That is the missing module you were looking for. If you create and run your script there, it will work just fine (as the tutorial suggests you do). Alternatively you could add the directory to your PYTHONPATH so that you can resolve it in any directory.

  • My raspberrypi directory is empty. I have both raspberrypi and python--but not in the same directory. And my epd2in7.py file is actually epd2in7b.py in the main directory. Both the raspberrypi and python directories are empty. – Josh Jun 27 '18 at 8:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.