Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ERROR] nonebot | Failed to import "gpttalk" #6

Open
ZYist opened this issue Feb 25, 2023 · 3 comments
Open

[ERROR] nonebot | Failed to import "gpttalk" #6

ZYist opened this issue Feb 25, 2023 · 3 comments

Comments

@ZYist
Copy link

ZYist commented Feb 25, 2023

Snipaste_2023-02-25_20-55-22

@OrangeMiracle
Copy link
Owner

OrangeMiracle commented Feb 25, 2023

你没进虚拟环境
请使用[启动机器人.txt]中的指令在powershell中先进入机器人文件夹,然后启动虚拟环境,再启动机器人

解决Windows下PowerShell无法进入Python虚拟环境 需要以管理员运行PowerShell,然后执行命令: Set-ExecutionPolicy RemoteSigned

在启动bot之前,请先进入Nonebot为你生成的虚拟环境,添加以下的包

pip install html

pip install selenium

pip install aiocqhttp

pip install sqlite3

pip install revChatGPT

pip install quart

@DARKPO1
Copy link

DARKPO1 commented Mar 10, 2023

使用虚拟环境: C:\Users\Administrator\Desktop\ChatGPT BUILD\ChatGPT-BUILD.venv\Scripts\python.exe
03-10 14:25:46 [SUCCESS] nonebot | NoneBot is initializing...
03-10 14:25:46 [INFO] nonebot | Current Env: dev
03-10 14:25:46 [DEBUG] nonebot | Loaded Config: {'driver': '~fastapi', 'host': IPv4Address('127.0.0.1'), 'port': 8080, 'log_level': 'DEBUG', 'api_timeout': 30.0, 'superusers': set(), 'nickname': set(), 'command_start': {'/'}, 'command_sep': {'.'}, 'session_expire_timeout': datetime.timedelta(seconds=120), 'environment': 'dev'}
03-10 14:25:46 [DEBUG] nonebot | Succeeded to load adapter "OneBot V11"
03-10 14:25:46 [SUCCESS] nonebot | Succeeded to import "echo"
03-10 14:25:47 [ERROR] nonebot | Failed to import "gpttalk"
Traceback (most recent call last):
File "", line 14, in
File "C:\Users\Administrator\Desktop\ChatGPT BUILD\ChatGPT-BUILD.venv\Lib\site-packages\nonebot\plugin\load.py", line 122, in load_from_toml
return load_all_plugins(plugins, plugin_dirs)
File "C:\Users\Administrator\Desktop\ChatGPT BUILD\ChatGPT-BUILD.venv\Lib\site-packages\nonebot\plugin\load.py", line 59, in load_all_plugins
return manager.load_all_plugins()
File "C:\Users\Administrator\Desktop\ChatGPT BUILD\ChatGPT-BUILD.venv\Lib\site-packages\nonebot\plugin\manager.py", line 168, in load_all_plugins
return set(
File "C:\Users\Administrator\Desktop\ChatGPT BUILD\ChatGPT-BUILD.venv\Lib\site-packages\nonebot\plugin\manager.py", line 169, in
filter(None, (self.load_plugin(name) for name in self.available_plugins))

File "C:\Users\Administrator\Desktop\ChatGPT BUILD\ChatGPT-BUILD.venv\Lib\site-packages\nonebot\plugin\manager.py", line 145, in load_plugin
module = importlib.import_module(
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\importlib_init_.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1206, in _gcd_import
File "", line 1178, in _find_and_load
File "", line 1149, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "C:\Users\Administrator\Desktop\ChatGPT BUILD\ChatGPT-BUILD.venv\Lib\site-packages\nonebot\plugin\manager.py", line 233, in exec_module
super().exec_module(module)
File "", line 940, in exec_module
File "", line 241, in call_with_frames_removed
File "C:\Users\Administrator\Desktop\ChatGPT BUILD\ChatGPT-BUILD\src\plugins\gpttalk_init
.py", line 32, in
active_bowser=(False or not('false' in str(nonebot.get_driver().config.active_bowser).lower())) #启动需要打开浏览器的部分,在.env.dev文件中修改,默认为False
AttributeError: 'Config' object has no attribute 'active_bowser'

gpttalk import 失败

@OrangeMiracle
Copy link
Owner

使用虚拟环境: C:\Users\Administrator\Desktop\ChatGPT BUILD\ChatGPT-BUILD.venv\Scripts\python.exe 03-10 14:25:46 [SUCCESS] nonebot | NoneBot is initializing... 03-10 14:25:46 [INFO] nonebot | Current Env: dev 03-10 14:25:46 [DEBUG] nonebot | Loaded Config: {'driver': '~fastapi', 'host': IPv4Address('127.0.0.1'), 'port': 8080, 'log_level': 'DEBUG', 'api_timeout': 30.0, 'superusers': set(), 'nickname': set(), 'command_start': {'/'}, 'command_sep': {'.'}, 'session_expire_timeout': datetime.timedelta(seconds=120), 'environment': 'dev'} 03-10 14:25:46 [DEBUG] nonebot | Succeeded to load adapter "OneBot V11" 03-10 14:25:46 [SUCCESS] nonebot | Succeeded to import "echo" 03-10 14:25:47 [ERROR] nonebot | Failed to import "gpttalk" Traceback (most recent call last): File "", line 14, in File "C:\Users\Administrator\Desktop\ChatGPT BUILD\ChatGPT-BUILD.venv\Lib\site-packages\nonebot\plugin\load.py", line 122, in load_from_toml return load_all_plugins(plugins, plugin_dirs) File "C:\Users\Administrator\Desktop\ChatGPT BUILD\ChatGPT-BUILD.venv\Lib\site-packages\nonebot\plugin\load.py", line 59, in load_all_plugins return manager.load_all_plugins() File "C:\Users\Administrator\Desktop\ChatGPT BUILD\ChatGPT-BUILD.venv\Lib\site-packages\nonebot\plugin\manager.py", line 168, in load_all_plugins return set( File "C:\Users\Administrator\Desktop\ChatGPT BUILD\ChatGPT-BUILD.venv\Lib\site-packages\nonebot\plugin\manager.py", line 169, in filter(None, (self.load_plugin(name) for name in self.available_plugins))

File "C:\Users\Administrator\Desktop\ChatGPT BUILD\ChatGPT-BUILD.venv\Lib\site-packages\nonebot\plugin\manager.py", line 145, in load_plugin
module = importlib.import_module(
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\importlib__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1206, in _gcd_import
File "", line 1178, in _find_and_load
File "", line 1149, in _find_and_load_unlocked
File "", line 690, in load_unlocked
File "C:\Users\Administrator\Desktop\ChatGPT BUILD\ChatGPT-BUILD.venv\Lib\site-packages\nonebot\plugin\manager.py", line 233, in exec_module
super().exec_module(module)
File "", line 940, in exec_module
File "", line 241, in call_with_frames_removed
File "C:\Users\Administrator\Desktop\ChatGPT BUILD\ChatGPT-BUILD\src\plugins\gpttalk__init
.py", line 32, in
active_bowser=(False or not('false' in str(nonebot.get_driver().config.active_bowser).lower())) #启动需要打开浏览器的部分,在.env.dev文件中修改,默认为False
AttributeError: 'Config' object has no attribute 'active_bowser'

gpttalk import 失败

在.env.dev文件中加入active_bowser=False,用于关闭需要浏览器的功能

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants