Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def ensure_PIL():
- try:
- import PIL
- except ModuleNotFoundError:
- print("Installing PIL")
- import subprocess
- r = subprocess.run(["pip", "install", "Pillow"])
- if r.returncode == 0:
- import PIL
- else:
- print("PIL could not be installed")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement