python - 在 32 位和 64 位 Python 中导入 PIL(枕头)时出错
问题描述
由于某种原因,我安装了两个 python 版本:3.7.7 32 位和 3.7.8 64 位。特定的行from PIL import Image
带来不同的错误。在 64 位中,我收到此错误:
Traceback (most recent call last):
File "equinox.py", line 20, in <module>
from PIL import Image, ImageOps,ImageFont, ImageDraw, ImageEnhance
File "C:\Users\FAMILY\AppData\Roaming\Python\Python37\site-packages\PIL\ImageEnhance.py", line 21, in <module>
from . import Image, ImageFilter, ImageStat
File "C:\Users\FAMILY\AppData\Roaming\Python\Python37\site-packages\PIL\ImageFilter.py", line 20, in <module>
import numpy
File "C:\Users\FAMILY\AppData\Roaming\Python\Python37\site-packages\numpy\__init__.py", line 138, in <module>
from . import _distributor_init
File "C:\Users\FAMILY\AppData\Roaming\Python\Python37\site-packages\numpy\_distributor_init.py", line 26, in <module>
WinDLL(os.path.abspath(filename))
File "C:\Users\FAMILY\AppData\Local\Programs\Python\Python37\lib\ctypes\__init__.py", line 364, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application
在 32 位中,我收到此错误:ImportError: cannot import _imaging from PIL
当它尝试from . import _imaging as core
.
我尝试通过重新安装 Python、重新安装 Pillow、删除剩余的 PIL 文件夹、检查已命名_imaging
PIL
Pillow
Image
但没有的目录中的任何文件来解决这两个问题。
任何人都可以帮忙吗?
解决方案
推荐阅读
- image-size - 当我将它们缩小时,图像看起来真的很糟糕
- python - 如何在pygame中删除图像?
- laravel - 服务器上的 Laravel 未加载样式表文件
- vue.js - 在 vueJS 中使用生命周期钩子将类添加到正文
- vba - 无法截取定义范围的屏幕截图 (JPEG)
- amazon-ecs - ECS容器中运行的进程能否在运行时确定其服务名称?
- sql - 唯一索引有什么用?
- winapi - ClientRect 神秘地比 WindowRect 小?
- java - 在按名称过滤的 Eclipse 上运行 junit 测试
- javascript - Paypal 按钮将 JSESSIONID 发送到 Spring 安全后端