I am trying to create an QRCode by using the 'qrcode' library. However, when I try to make an image, I get the following error:
Traceback (most recent call last):
File "C:\Program Files (x86)\Python 3.5\lib\site-packages\qrcode\image\pil.py", line 6, in <module>
from PIL import Image, ImageDraw
ImportError: No module named 'PIL'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/Floris/Documents/GitHub/MiniProject-GroepV1L/TEST_QR.py", line 4, in <module>
img = qrcode.make(string)
File "C:\Program Files (x86)\Python 3.5\lib\site-packages\qrcode\main.py", line 11, in make
return qr.make_image()
File "C:\Program Files (x86)\Python 3.5\lib\site-packages\qrcode\main.py", line 256, in make_image
from qrcode.image.pil import PilImage
File "C:\Program Files (x86)\Python 3.5\lib\site-packages\qrcode\image\pil.py", line 8, in <module>
import Image
ImportError: No module named 'Image'
The code I have right now is:
import qrcode
string = "This is a test string for StackOverflow"
img = qrcode.make(string)
You have to install Pillow:
pip install pillow
And probably some other dependencies.
You should have installed the qrcode package using pip so that the dependencies would have been installed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With