【问题标题】:"Can't import the Python Imaging Library"“无法导入 Python 映像库”
【发布时间】:2020-08-31 21:33:07
【问题描述】:

我已经下载了uniconvertor 以在Debian 10 上从cdr 转换为svg(没有更多的这个包,所以我必须从源代码下载)。现在尝试执行时:

$uniconv image.cdr image.svg,我知道了:

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

似乎我没有“图像库”并收到错误NameError: global name 'warn' is not defined,这是否意味着该脚本中未定义函数warn

【问题讨论】:

  • warnings 包只需要导入即可。

标签: python python-imaging-library


【解决方案1】:

您的应用似乎需要 Python PIL 库才能工作,但您没有安装它。尝试安装它https://pypi.org/project/Pillow/

【讨论】:

    【解决方案2】:

    您必须遵循两个步骤。

    1. import warnings 在你的 python 文件中

    2. 安装枕头,PIL 已死。使用枕头pip install Pillow

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-08-11
      • 1970-01-01
      • 1970-01-01
      • 2020-11-07
      • 2016-09-18
      • 2018-11-30
      • 1970-01-01
      相关资源
      最近更新 更多