noneplugin/nonebot-plugin-memes

加载时报错

coder-tq opened this issue · 5 comments

ImportError: cannot import name 'Transform' from 'PIL.Image' (/usr/local/lib/python3.10/site-packages/PIL/Image.py)
是需要更新python版本或者需要导入什么包吗

01-18 10:43:52 [ERROR] nonebot | Failed to import "nonebot_plugin_memes"
Traceback (most recent call last):
File "/usr/local/bin/nb", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1128, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/nb_cli/commands/main.py", line 30, in run
run_bot(file, app)
File "/usr/local/lib/python3.10/site-packages/nb_cli/handlers/deploy.py", line 19, in run_bot
module = importlib.import_module(module_name)
File "/usr/local/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/home/robot/NoneBot/./bot.py", line 28, in
nonebot.load_from_toml("pyproject.toml")
File "/usr/local/lib/python3.10/site-packages/nonebot/plugin/load.py", line 122, in load_from_toml
return load_all_plugins(plugins, plugin_dirs)
File "/usr/local/lib/python3.10/site-packages/nonebot/plugin/load.py", line 59, in load_all_plugins
return manager.load_all_plugins()
File "/usr/local/lib/python3.10/site-packages/nonebot/plugin/manager.py", line 168, in load_all_plugins
return set(
File "/usr/local/lib/python3.10/site-packages/nonebot/plugin/manager.py", line 169, in
filter(None, (self.load_plugin(name) for name in self.available_plugins))

File "/usr/local/lib/python3.10/site-packages/nonebot/plugin/manager.py", line 141, in load_plugin
module = importlib.import_module(name)
File "/usr/local/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "/usr/local/lib/python3.10/site-packages/nonebot/plugin/manager.py", line 233, in exec_module
super().exec_module(module)
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/usr/local/lib/python3.10/site-packages/nonebot_plugin_memes/init.py", line 30, in
from .data_source import memes
File "/usr/local/lib/python3.10/site-packages/nonebot_plugin_memes/data_source.py", line 2, in
from .normal_memes import *
File "/usr/local/lib/python3.10/site-packages/nonebot_plugin_memes/normal_memes.py", line 7, in
from PIL.Image import Transform, Resampling
ImportError: cannot import name 'Transform' from 'PIL.Image' (/usr/local/lib/python3.10/site-packages/PIL/Image.py)

你的pillow是什么版本

你的pillow是什么版本

9.0.1

升级pillow试试

ok了,启动成功