I have written code to compress image in .py file and tried to compile using transcrypt to convert to JS file. During this process i got the below error(screen shot) But if i run the .py file separately using IDE ,it works fine & compress the image.
Code:
import PIL
from PIL import Image as pil
class FileUpload:
def Images (self,arg):
# Open the image
im = pil.open(arg)
# Now save it
im.save("img_compressed.jpg", format="JPEG", quality=90)
fileupload = FileUpload()
Error :
\python src\imgcompress>python -m transcrypt -b -m -n imageCompress.py
Transcrypt (TM) Python to JavaScript Small Sane Subset Transpiler Version 3.6.101
Copyright (C) Geatec Engineering. License: Apache 2.0
Error while compiling (offending file last):
File '/python src/imgcompress/imageCompress.py', line 1, at import of:
File '/python/lib/site-packages/PIL/__init__.py', line 14, namely:
Can't import module 'PIL'
Aborted