python - undefined symbol : PyUnicodeUCS4_AsLatin1String when installing Pillow for local Python

标签 python pip python-imaging-library

我使用 pip 安装 Pillow。它表示 Pillow 安装成功。但是当在 Python (v2.7.8) 中,我输入 from PIL import Image 时,我得到了这个错误:

ImportError: /home/local/python2/lib/python2.7/site-packages/PIL/PIL/_imaging.so: undefined symbol: PyUnicodeUCS4_AsLatin1String

问题是我有一个本地 python v2.7.8 安装,它适用于 maxunicode: 65535 的 UCS2。但是 PIL 库是由系统默认的 Python 2.7.6 版本构建和安装的,这是UCS4。我怀疑 pip 调用了默认的 python v2.7.6。

  1. 如何让 pip 使用我本地的 python v2.7.8 来安装 Pillow 而不是使用系统默认的 python?
  2. 如何制作专为 UCS2 而不是 UCS4 构建的 Pillow?
  3. 我需要为本地 python v2.7.8 安装不同的 pip 吗?当前 pip 在系统 python 的/usr/bin/中。

非常感谢!

最佳答案

如果您使用的是 Windows 机器,请尝试从此处下载二进制文件 download python libraries

在这里,您可以选择提供要安装的 python 版本。

关于python - undefined symbol : PyUnicodeUCS4_AsLatin1String when installing Pillow for local Python,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26965487/

相关文章:

python - 将 bson 写入磁盘时出现内存不足错误

python - 用python进行简单的数值计算

python - 将列表中缺失的元素作为每个时间窗口组的行插入到 DataFrame

python - 我可以使用 `pip` 而不是 `easy_install` 进行 `python setup.py install` 依赖解析吗?

python - PIL(Python 3.4)修改RGV值

python - 使用 Scipy 在 Python 中进行方差分析,无需手动输入每个组名称

macos - 安装 tensorflow 时出现错误 setuptools

python - Keras 的 ImageDataGenerator 在访问图像文件时随机抛出错误

python - 如何在 termux 上安装 Pillow?

python - pip 配置了需要 TLS/SSL 的位置