milanHrabos
milanHrabos

Reputation: 1965

"Can't import the Python Imaging Library"

I have downloaded the uniconvertor to convert from cdr to svg on Debian 10 (which has no more this package, so I have to download from source). Now when trying to execute:

$uniconv image.cdr image.svg, I got this:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/uniconvertor/__init__.py", line 64, in <module>
    from app.io import load
  File "/usr/local/lib/python2.7/dist-packages/uniconvertor/app/__init__.py", line 62, in <module>
    from conf.configurator import Configurator
  File "/usr/local/lib/python2.7/dist-packages/uniconvertor/app/conf/configurator.py", line 11, in <module>
    frm app.events import connector
  File "/usr/local/lib/python2.7/dist-packages/uniconvertor/app/__init__.py", line 114, in <module>
    _import_PIL()
  File "/usr/local/lib/python2.7/dist-packages/uniconvertor/app/__init__.py", line 103, in _import_PIL
    warn.warn(warn.USER, "Can't import the Python Imaging Library")
NameError: global name 'warn' is not defined

Seems I have not "Imaging Library" and get error NameError: global name 'warn' is not defined, does it mean the function warn is not defined in that script?

Upvotes: 1

Views: 345

Answers (2)

Lokesh Lalwani
Lokesh Lalwani

Reputation: 155

You'll have to follow two steps.

  1. import warnings in your python file

  2. Install pillow, PIL is Dead. Use Pillow pip install Pillow.

Upvotes: 0

Simone Pozzoli
Simone Pozzoli

Reputation: 107

It seems your app needs Python PIL library to work but you don't have it installed. Try installing it https://pypi.org/project/Pillow/.

Upvotes: 1

Related Questions