iljabauer / python-escpos

Automatically exported from code.google.com/p/python-escpos
GNU General Public License v3.0
0 stars 0 forks source link

ImportError: No module named Image #15

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I'm getting an import error after following the instructions for the Raspberry 
Pi.  It's a fresh install of the latest Raspbian image, and I'm using an Epson 
TM-T20 over USB.  I installed the dependencies as per the instructions, and 
obtained the vendor and product ID.

This is my test code:

from escpos import *
Epson = printer.Usb(0x04b8,0x0e03)
Epson.text("Hello World\n")
Epson.cut()

This is the error message:

Traceback (most recent call last):
  File "test.py", line 1, in <module>
    from escpos import *
  File "/usr/local/lib/python2.7/dist-packages/escpos/escpos.py", line 9, in <module>
    import Image
ImportError: No module named Image

Can anyone help?

Original issue reported on code.google.com by jx2DITIv...@googlemail.com on 11 Oct 2013 at 5:15

GoogleCodeExporter commented 9 years ago
I'm sorry about the confusion,
you also need to install python-imaging and pyserial.

I've updated the wiki accordingly.

Thank you.

Original comment by manpaz on 11 Oct 2013 at 2:33

GoogleCodeExporter commented 9 years ago
It still doesn't work properly.  "pyserial" is not in the Pi's repository, so I 
built it from source like the other packages.  It at least prints a hello world 
now, but barcodes only print the text portion.  Images print garbage ASCII, and 
QR codes throw an error.

The line:

Epson.qr("You can read me from your smartphone")

results in the error:

Traceback (most recent call last):
  File "test.py", line 8, in <module>
    Epson.qr("You can read me from your smartphone")
AttributeError: Usb instance has no attribute 'qr'

This is after manually installing the python-qrcode package, and the 
python-imaging package.

Original comment by jx2DITIv...@googlemail.com on 11 Oct 2013 at 10:41

GoogleCodeExporter commented 9 years ago
Do you mind to tell me which version of python-escpos are you using?

Original comment by manpaz on 12 Oct 2013 at 12:10

GoogleCodeExporter commented 9 years ago
It's version 1.0-1
I also tried version 1.0

Original comment by jx2DITIv...@googlemail.com on 12 Oct 2013 at 1:31

GoogleCodeExporter commented 9 years ago
Hello,

I've got the same error message AttributeError: Usb instance has no attribute 
'qr'.
I have search and it comes from the version of python-escpos, I've used the 
1.0, so QR code method are available with the package 1.0-1.

I have updated the version of python-escpos and everything is working well as : 

Epson.qr("You can read me from your smartphone")

Hope it will help you

Regards

Ben

Original comment by bennyboo...@gmail.com on 12 Jan 2014 at 10:54