AreCie / Apex_Tool

APEX英雄QQ群查询插件,适用于真寻Bot
MIT License
35 stars 7 forks source link

载入时报错 ModuleNotFoundError: No module named 'requests' #2

Closed Otakusprpr closed 2 years ago

Otakusprpr commented 2 years ago

大佬你好,我在安装这个插件的时候发现插件载入失败,使用的是Windows Server 2012 R2,尝试过pip install requests显示已安装,pip list里也能看到requests,因为没有相关基础实在琢磨不懂了,大佬可以帮忙看看吗?

06-04 14:12:36 [ERROR] nonebot | Failed to import "Apex_Tool" Traceback (most recent call last):

File "C:\Users\Administrator\Desktop\zhenxun_bot-main\zhenxun_bot-main\bot.py", line 14, in nonebot.load_plugins("plugins") │ └ <function load_plugins at 0x00000013496F7DC0> └ <module 'nonebot' from 'C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot--1-ZcKUM-py3.9\l...

File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot--1-ZcKUM-py3.9\lib\site-packages\nonebot\plugin\load.py", line 39, in load_plugins return manager.load_all_plugins() │ └ <function PluginManager.load_all_plugins at 0x00000013496F29D0> └ <nonebot.plugin.manager.PluginManager object at 0x000000134ACA6EE0>

File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot--1-ZcKUM-py3.9\lib\site-packages\nonebot\plugin\manager.py", line 128, in load_all_plugins return set(

File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot--1-ZcKUM-py3.9\lib\site-packages\nonebot\plugin\manager.py", line 129, in filter(None, (self.load_plugin(name) for name in self.list_plugins())) │ │ │ │ │ └ <function PluginManager.list_plugins at 0x00000013496F28B0> │ │ │ │ └ <nonebot.plugin.manager.PluginManager object at 0x000000134ACA6EE0> │ │ │ └ 'Apex_Tool' │ │ └ 'Apex_Tool' │ └ <function PluginManager.load_plugin at 0x00000013496F2940> └ <nonebot.plugin.manager.PluginManager object at 0x000000134ACA6EE0>

File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot--1-ZcKUM-py3.9\lib\site-packages\nonebot\plugin\manager.py", line 106, in load_plugin module = importlib.import_module( │ └ <function import_module at 0x00000013469DB160> └ <module 'importlib' from 'C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\importlib\init.py'>

File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\importlib__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) │ │ │ │ │ └ 0 │ │ │ │ └ None │ │ │ └ 0 │ │ └ 'plugins.Apex_Tool' │ └ <function _gcd_import at 0x00000013465813A0> └ <module 'importlib._bootstrap' (frozen)>

File "", line 1030, in _gcd_import File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 680, in _load_unlocked

File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot--1-ZcKUM-py3.9\lib\site-packages\nonebot\plugin\manager.py", line 194, in exec_module super().exec_module(module) └ <module 'plugins.Apex_Tool' from 'C:\Users\Administrator\Desktop\zhenxun_bot-main\zhenxun_bot-main\plugins\Apex_Tool\...

File "", line 850, in exec_module File "", line 228, in _call_with_frames_removed

File "C:\Users\Administrator\Desktop\zhenxun_bot-main\zhenxun_bot-main\plugins\Apex_Tool__init__.py", line 11, in from .utils import *

File "C:\Users\Administrator\Desktop\zhenxun_bot-main\zhenxun_bot-main\plugins\Apex_Tool\utils.py", line 1, in import requests

ModuleNotFoundError: No module named 'requests'

AreCie commented 2 years ago

大佬你好,我在安装这个插件的时候发现插件载入失败,使用的是Windows Server 2012 R2,尝试过pip install requests显示已安装,pip list里也能看到requests,因为没有相关基础实在琢磨不懂了,大佬可以帮忙看看吗?

06-04 14:12:36 [ERROR] nonebot | Failed to import "Apex_Tool" Traceback (most recent call last):

File "C:\Users\Administrator\Desktop\zhenxun_bot-main\zhenxun_bot-main\bot.py", line 14, in nonebot.load_plugins("plugins") │ └ <function load_plugins at 0x00000013496F7DC0> └ <module 'nonebot' from 'C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot--1-ZcKUM-py3.9\l...

File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot--1-ZcKUM-py3.9\lib\site-packages\nonebot\plugin\load.py", line 39, in load_plugins return manager.load_all_plugins() │ └ <function PluginManager.load_all_plugins at 0x00000013496F29D0> └ <nonebot.plugin.manager.PluginManager object at 0x000000134ACA6EE0>

File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot--1-ZcKUM-py3.9\lib\site-packages\nonebot\plugin\manager.py", line 128, in load_all_plugins return set(

File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot--1-ZcKUM-py3.9\lib\site-packages\nonebot\plugin\manager.py", line 129, in filter(None, (self.load_plugin(name) for name in self.list_plugins())) │ │ │ │ │ └ <function PluginManager.list_plugins at 0x00000013496F28B0> │ │ │ │ └ <nonebot.plugin.manager.PluginManager object at 0x000000134ACA6EE0> │ │ │ └ 'Apex_Tool' │ │ └ 'Apex_Tool' │ └ <function PluginManager.load_plugin at 0x00000013496F2940> └ <nonebot.plugin.manager.PluginManager object at 0x000000134ACA6EE0>

File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot--1-ZcKUM-py3.9\lib\site-packages\nonebot\plugin\manager.py", line 106, in load_plugin module = importlib.import_module( │ └ <function import_module at 0x00000013469DB160> └ <module 'importlib' from 'C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\importlib**init**.py'>

File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\importlibinit.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) │ │ │ │ │ └ 0 │ │ │ │ └ None │ │ │ └ 0 │ │ └ 'plugins.Apex_Tool' │ └ <function _gcd_import at 0x00000013465813A0> └ <module 'importlib._bootstrap' (frozen)>

File "", line 1030, in _gcd_import File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 680, in _load_unlocked

File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot--1-ZcKUM-py3.9\lib\site-packages\nonebot\plugin\manager.py", line 194, in exec_module super().exec_module(module) └ <module 'plugins.Apex_Tool' from 'C:\Users\Administrator\Desktop\zhenxun_bot-main\zhenxun_bot-main\plugins\Apex_Tool...

File "", line 850, in exec_module File "", line 228, in _call_with_frames_removed

File "C:\Users\Administrator\Desktop\zhenxun_bot-main\zhenxun_bot-main\plugins\Apex_Toolinit.py", line 11, in from .utils import *

File "C:\Users\Administrator\Desktop\zhenxun_bot-main\zhenxun_bot-main\plugins\Apex_Tool\utils.py", line 1, in import requests

ModuleNotFoundError: No module named 'requests'

没有【requests】这个模块,安装下就行 pip install requests

Otakusprpr commented 2 years ago

感谢大佬回复! image 但是很奇怪,我尝试pip install request也显示已安装,pip list里也有,但就是在载入的时候报错,很不解 image

AreCie commented 2 years ago

感谢大佬回复! image 但是很奇怪,我尝试pip install request也显示已安装,pip list里也有,但就是在载入的时候报错,很不解 image

在虚拟环境里安装,就是poetry shell里面,之前我也遇到过

Otakusprpr commented 2 years ago

万分感谢!刚刚跑起来了,的确要在poetry shell里安装,谢谢大佬!