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

这是哪的问题,运行成功,但是不能对话 #20

Closed
longwangjiang opened this issue Dec 30, 2022 · 5 comments
Closed

这是哪的问题,运行成功,但是不能对话 #20

longwangjiang opened this issue Dec 30, 2022 · 5 comments

Comments

@longwangjiang
Copy link

Start auto replying.
[ERROR][2022-12-30 10:23:37][wechat_channel.py:115] - No module named 'openai'
Traceback (most recent call last):
File "/root/chatgpt-on-wechat/channel/wechat/wechat_channel.py", line 111, in _do_send
reply_text = super().build_reply_content(query, context).strip()
File "/root/chatgpt-on-wechat/channel/channel.py", line 31, in build_reply_content
return Bridge().fetch_reply_content(query, context)
File "/root/chatgpt-on-wechat/bridge/bridge.py", line 9, in fetch_reply_content
return bot_factory.create_bot("openAI").reply(query, context)
File "/root/chatgpt-on-wechat/bot/bot_factory.py", line 24, in create_bot
from bot.openai.open_ai_bot import OpenAIBot
File "/root/chatgpt-on-wechat/bot/openai/open_ai_bot.py", line 6, in
import openai
ModuleNotFoundError: No module named 'openai'

@zhayujie
Copy link
Owner

提示没有安装openai,需要安装一下:

pip3 install openai==0.25.0

注意要安装在启动这个项目的Python下

@longwangjiang
Copy link
Author

我记得装了openai,重新装了一下,个人聊天正常了,微信群里怎么使用这个ai?加bot前缀使用不了。。。还有就是报错。不知道是哪的问题,看样子是python的问题,这个是依赖没装还是版本有问题。
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 710, in urlopen
chunked=chunked,
File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 449, in _make_request
six.raise_from(e, None)
File "", line 3, in raise_from
File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 444, in _make_request
httplib_response = conn.getresponse()
File "/usr/lib/python3.7/http/client.py", line 1352, in getresponse
response.begin()
File "/usr/lib/python3.7/http/client.py", line 310, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.7/http/client.py", line 279, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/requests/adapters.py", line 499, in send
timeout=timeout,
File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 788, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "/usr/local/lib/python3.7/dist-packages/urllib3/util/retry.py", line 550, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/usr/local/lib/python3.7/dist-packages/urllib3/packages/six.py", line 769, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 710, in urlopen
chunked=chunked,
File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 449, in _make_request
six.raise_from(e, None)
File "", line 3, in raise_from
File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 444, in _make_request
httplib_response = conn.getresponse()
File "/usr/lib/python3.7/http/client.py", line 1352, in getresponse
response.begin()
File "/usr/lib/python3.7/http/client.py", line 310, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.7/http/client.py", line 279, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/itchat/components/login.py", line 294, in maintain_loop
msgList, contactList = self.get_msg()
File "/usr/local/lib/python3.7/dist-packages/itchat/components/login.py", line 382, in get_msg
headers=headers, timeout=config.TIMEOUT)
File "/usr/local/lib/python3.7/dist-packages/requests/sessions.py", line 635, in post
return self.request("POST", url, data=data, json=json, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/requests/sessions.py", line 587, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.7/dist-packages/requests/sessions.py", line 701, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/requests/adapters.py", line 547, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

@zhayujie
Copy link
Owner

我记得装了openai,重新装了一下,个人聊天正常了,微信群里怎么使用这个ai?加bot前缀使用不了。。。还有就是报错。不知道是哪的问题,看样子是python的问题,这个是依赖没装还是版本有问题。 Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 710, in urlopen chunked=chunked, File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 449, in _make_request six.raise_from(e, None) File "", line 3, in raise_from File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 444, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.7/http/client.py", line 1352, in getresponse response.begin() File "/usr/lib/python3.7/http/client.py", line 310, in begin version, status, reason = self._read_status() File "/usr/lib/python3.7/http/client.py", line 279, in _read_status raise RemoteDisconnected("Remote end closed connection without" http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/requests/adapters.py", line 499, in send timeout=timeout, File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 788, in urlopen method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2] File "/usr/local/lib/python3.7/dist-packages/urllib3/util/retry.py", line 550, in increment raise six.reraise(type(error), error, _stacktrace) File "/usr/local/lib/python3.7/dist-packages/urllib3/packages/six.py", line 769, in reraise raise value.with_traceback(tb) File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 710, in urlopen chunked=chunked, File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 449, in _make_request six.raise_from(e, None) File "", line 3, in raise_from File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 444, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.7/http/client.py", line 1352, in getresponse response.begin() File "/usr/lib/python3.7/http/client.py", line 310, in begin version, status, reason = self._read_status() File "/usr/lib/python3.7/http/client.py", line 279, in _read_status raise RemoteDisconnected("Remote end closed connection without" urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/itchat/components/login.py", line 294, in maintain_loop msgList, contactList = self.get_msg() File "/usr/local/lib/python3.7/dist-packages/itchat/components/login.py", line 382, in get_msg headers=headers, timeout=config.TIMEOUT) File "/usr/local/lib/python3.7/dist-packages/requests/sessions.py", line 635, in post return self.request("POST", url, data=data, json=json, **kwargs) File "/usr/local/lib/python3.7/dist-packages/requests/sessions.py", line 587, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python3.7/dist-packages/requests/sessions.py", line 701, in send r = adapter.send(request, **kwargs) File "/usr/local/lib/python3.7/dist-packages/requests/adapters.py", line 547, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

群聊天只要被艾特就会自动回复;另外加@bot前缀也能触发,对应的配置是group_chat_prefix, 可以修改。

这个报错应该是网络通信有些不稳定,如果不影响正常运行的话可以不用管

@longwangjiang
Copy link
Author

用后台运行,用一会就用不了了,看了一下nohup.out提示
IndexError: tuple index out of range

LOG OUT!
这个怎么解决。。。。怎么守护一下进程。

@zhayujie
Copy link
Owner

zhayujie commented Jan 1, 2023

用后台运行,用一会就用不了了,看了一下nohup.out提示 IndexError: tuple index out of range

LOG OUT! 这个怎么解决。。。。怎么守护一下进程。

see #21

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

2 participants