Giter VIP home page Giter VIP logo

Comments (7)

MistEO avatar MistEO commented on September 27, 2024 1

我也是 python 小白,没有遇到过这个错误 orz

感觉可能的尝试:

  1. 试试用 nb run 来启动,因为我自己都是这样启动的
  2. 自己新建一个 nb 项目,也选 gocq 相关配置,试试能启动吗?

from pallas-bot.

MistEO avatar MistEO commented on September 27, 2024 1

Windows 可以参考 这个,或者搜索别的教程

from pallas-bot.

NtskwK avatar NtskwK commented on September 27, 2024

非常感谢!
可能是因为配置的原因,服务器无法识别nb指令,于是我从头重新进行了配置(从部署python-dev开始)。
……
系统提示我requirements.txt的第3行和第21行是一样的,尽管看上去有些差别,但我还是删掉了21行才再次进行配置。
另外,我发现nonebot_plugin_apscheduler有的时候会因为pyproject.toml无法部署,我不清楚昨晚造成这个问题的原因是什么,但现在使用了go-cqhttp自动生成的config后,Pallas已经能成功接收go-cqhttp的信息了。nb run已经能启动了。
屏幕截图 2022-03-12 162257
但由于多次测试“强行教“的时候,Pallas没有给出除上图以外的其他反应,我无法判断是学习次数不够还是出了什么其他的问题。于是我浏览了日志,发现了这一条

03-12 15:53:18 [ERROR] nonebot | Failed to import "repeater"
我想这可能和出现的问题有关

from pallas-bot.

MistEO avatar MistEO commented on September 27, 2024

03-12 15:53:18 [ERROR] nonebot | Failed to import "repeater"

是有关的,这个就是牛牛复读的核心插件

启动的时候会依次加载各个插件,看看报啥错

from pallas-bot.

NtskwK avatar NtskwK commented on September 27, 2024

现在,repeater所需的nonebot_plugin_apscheduler已经能正常安装,并且安装过程中没有报错。
我先运行了go-cqhttp,然后启动了Pallas,并在同时记录了Pallas的启动日志。其中我认为比较重要的部分大致如下

03-12 23:55:54 [ERROR] nonebot | Failed to import "repeater"
Traceback (most recent call last):
File "C:\Users\11240\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\11240\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "C:\Users\11240\AppData\Local\Programs\Python\Python310\Scripts\nb.exe_main
.py", line 7, in
sys.exit(main())
File "C:\Users\11240\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1128, in call
return self.main(*args, **kwargs)
File "C:\Users\11240\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1053, in main
rv = self.invoke(ctx)
File "C:\Users\11240\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Users\11240\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\11240\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 754, in invoke
return _callback(*args, **kwargs)
File "C:\Users\11240\AppData\Local\Programs\Python\Python310\lib\site-packages\nb_cli\commands\main.py", line 30, in run
run_bot(file, app)
File "C:\Users\11240\AppData\Local\Programs\Python\Python310\lib\site-packages\nb_cli\handlers\deploy.py", line 19, in run_bot
module = importlib.import_module(module_name)
File "C:\Users\11240\AppData\Local\Programs\Python\Python310\lib\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 "E:\Program\ChatBot\Pallas-Bot.\bot.py", line 24, in
nonebot.load_from_toml("pyproject.toml")
File "C:\Users\11240\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\plugin_init
.py", line 1089, in load_from_toml
return load_all_plugins(set(plugins), set(plugin_dirs))
File "C:\Users\11240\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\plugin_init
.py", line 1031, in load_all_plugins
result = context.run(load_plugin, manager, plugin_name)
File "C:\Users\11240\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\plugin_init
.py", line 953, in load_plugin
module = manager.load_plugin(plugin_name)
File "C:\Users\11240\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\plugin\manager.py", line 161, in load_plugin
return importlib.import_module(f"{self.namespace}.{name}")
File "C:\Users\11240\AppData\Local\Programs\Python\Python310\lib\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 "C:\Users\11240\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\plugin\manager.py", line 267, in exec_module
super().exec_module(module)
File "", line 883, in exec_module
File "", line 241, in call_with_frames_removed
File "E:\Program\ChatBot\Pallas-Bot\bot/plugins\repeater_init
.py", line 13, in
from .model import Chat, ChatData
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "C:\Users\11240\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\plugin\manager.py", line 267, in exec_module
super().exec_module(module)
File "E:\Program\ChatBot\Pallas-Bot\bot/plugins\repeater\model.py", line 26, in
message_mongo.create_index(name='time_index',
File "C:\Users\11240\AppData\Local\Programs\Python\Python310\lib\site-packages\pymongo\collection.py", line 2101, in create_index
return self.__create_indexes([index], session, **cmd_options)[0]
File "C:\Users\11240\AppData\Local\Programs\Python\Python310\lib\site-packages\pymongo\collection.py", line 1961, in __create_indexes
with self._socket_for_writes(session) as sock_info:
File "C:\Users\11240\AppData\Local\Programs\Python\Python310\lib\site-packages\pymongo\collection.py", line 198, in _socket_for_writes
return self.__database.client._socket_for_writes(session)
File "C:\Users\11240\AppData\Local\Programs\Python\Python310\lib\site-packages\pymongo\mongo_client.py", line 1356, in _socket_for_writes
server = self._select_server(writable_server_selector, session)
File "C:\Users\11240\AppData\Local\Programs\Python\Python310\lib\site-packages\pymongo\mongo_client.py", line 1346, in _select_server
server = topology.select_server(server_selector)
File "C:\Users\11240\AppData\Local\Programs\Python\Python310\lib\site-packages\pymongo\topology.py", line 244, in select_server
return random.choice(self.select_servers(selector,
File "C:\Users\11240\AppData\Local\Programs\Python\Python310\lib\site-packages\pymongo\topology.py", line 202, in select_servers
server_descriptions = self._select_servers_loop(
File "C:\Users\11240\AppData\Local\Programs\Python\Python310\lib\site-packages\pymongo\topology.py", line 218, in _select_servers_loop
raise ServerSelectionTimeoutError(
pymongo.errors.ServerSelectionTimeoutError: 127.0.0.1:27017: [WinError 10061] 由于目标计算机积极拒绝,无法连接。, Timeout: 30s, Topology Description: <TopologyDescription id: 622cc26bc2bf6195f411faa2, topology_type: Single, servers: [<ServerDescription ('127.0.0.1', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('127.0.0.1:27017: [WinError 10061] 由于目标计算机积极拒绝,无法连接。')>]>

全部的日志总共有400行左右,但大部分似乎都是因为Pallas与go-cqhttp对接超时后进行重试产生的。(尽管后来对接成功了)
我搞不懂这部分提示当中的线索。完整的日志内容我会在稍后发到你的hotmail邮箱

from pallas-bot.

MistEO avatar MistEO commented on September 27, 2024

你是不是没有配置和启动 MongoDB_(:з」∠)_

from pallas-bot.

NtskwK avatar NtskwK commented on September 27, 2024

我重新检查了MongoDB的配置情况,它之前似乎没有成功被写进PATH中🦁
(发生的具体原因可能和之前nb无法被识别类似)
于是在修复并排查了其他问题后,Pallas已经能正常运行了!
非常感谢您的帮助!

from pallas-bot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.