XTxiaoting14332 / nonebot-plugin-chatglm-plus

人性化的ChatGLM插件,使用智谱API-key 支持上下文
GNU General Public License v3.0
8 stars 2 forks source link

自定义聊天记录储存路径出现错误 #12

Open SZ2528 opened 5 months ago

SZ2528 commented 5 months ago
06-23 11:57:14 [ERROR] nonebot | Failed to import "nonebot_plugin_chatglm_plus"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Program Files\Python310\lib\multiprocessing\spawn.py", line 116, in spawn_main
    exitcode = _main(fd, parent_sentinel)
  File "C:\Program Files\Python310\lib\multiprocessing\spawn.py", line 125, in _main
    prepare(preparation_data)
  File "C:\Program Files\Python310\lib\multiprocessing\spawn.py", line 236, in prepare
    _fixup_main_from_path(data['init_main_from_path'])
  File "C:\Program Files\Python310\lib\multiprocessing\spawn.py", line 287, in _fixup_main_from_path
    main_content = runpy.run_path(main_path,
  File "C:\Program Files\Python310\lib\runpy.py", line 289, in run_path
    return _run_module_code(code, init_globals, run_name,
  File "C:\Program Files\Python310\lib\runpy.py", line 96, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "C:\Program Files\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "E:\lhcbot-byshushu0401zip~\lhcbot\bot.py", line 30, in <module>
    nonebot.load_from_toml("pyproject.toml")
  File "C:\Users\rain1\AppData\Roaming\Python\Python310\site-packages\nonebot\plugin\load.py", line 131, in load_from_toml
    return load_all_plugins(plugins, plugin_dirs)
  File "C:\Users\rain1\AppData\Roaming\Python\Python310\site-packages\nonebot\plugin\load.py", line 65, in load_all_plugins
    return manager.load_all_plugins()
  File "C:\Users\rain1\AppData\Roaming\Python\Python310\site-packages\nonebot\plugin\manager.py", line 203, in load_all_plugins
    return set(
  File "C:\Users\rain1\AppData\Roaming\Python\Python310\site-packages\nonebot\plugin\manager.py", line 204, in <genexpr>
    filter(None, (self.load_plugin(name) for name in self.available_plugins))
> File "C:\Users\rain1\AppData\Roaming\Python\Python310\site-packages\nonebot\plugin\manager.py", line 167, in load_plugin
    module = importlib.import_module(self._third_party_plugin_ids[name])
  File "C:\Program Files\Python310\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "C:\Users\rain1\AppData\Roaming\Python\Python310\site-packages\nonebot\plugin\manager.py", line 255, in exec_module
    super().exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "C:\Users\rain1\AppData\Roaming\Python\Python310\site-packages\nonebot_plugin_chatglm_plus\__init__.py", line 89, in <module>
    log_dir.mkdir(parents=True, exist_ok=True)
AttributeError: 'str' object has no attribute 'mkdir'
SZ2528 commented 5 months ago

.dev文件内容

glm_history_path="E:\bot114514\lbot\chat114514.txt"
Cherryluoying commented 5 months ago

这个配置应该是选择一个目录,不是让你选择文件

XTxiaoting14332 commented 5 months ago

填的是目录而不是文件路径