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

调用智谱API失败 #2399

Open
2 tasks done
caixinyuan opened this issue Nov 26, 2024 · 3 comments
Open
2 tasks done

调用智谱API失败 #2399

caixinyuan opened this issue Nov 26, 2024 · 3 comments

Comments

@caixinyuan
Copy link

前置确认

  • 我确认我运行的是最新版本的代码,并且安装了所需的依赖,在FAQS中也未找到类似问题。

⚠️ 搜索issues中是否已存在类似问题

  • 我已经搜索过issues和disscussions,没有跟我遇到的问题相关的issue

操作系统类型?

Linux

运行的python版本是?

python 3.9

使用的chatgpt-on-wechat版本是?

Latest Release

运行的channel类型是?

wx(个人微信, itchat)

复现步骤 🕹

调用智谱 glm-4 模型失败

问题描述 😯

No response

终端日志 📒

[ERROR][2024-11-26 21:32:36][chat_channel.py:303] - Worker return exception: No module named 'pydantic_core._pydantic_core'
Traceback (most recent call last):
  File "/usr/lib/python3.9/concurrent/futures/thread.py", line 58, in run
  File "/root/chatgpt-on-wechat/channel/chat_channel.py", line 170, in _handle
    reply = self._generate_reply(context)
  File "/root/chatgpt-on-wechat/channel/chat_channel.py", line 182, in _generate_reply
    e_context = PluginManager().emit_event(
  File "/root/chatgpt-on-wechat/plugins/plugin_manager.py", line 191, in emit_event
    instance.handlers[e_context.event](e_context, *args, **kwargs)
  File "/root/chatgpt-on-wechat/plugins/role/role.py", line 105, in on_handle_context
    bot = Bridge().get_bot("chat")
  File "/root/chatgpt-on-wechat/bridge/bridge.py", line 74, in get_bot
    self.bots[typename] = create_bot(self.btype[typename])
  File "/root/chatgpt-on-wechat/bot/bot_factory.py", line 60, in create_bot
    from bot.zhipuai.zhipuai_bot import ZHIPUAIBot
  File "/root/chatgpt-on-wechat/bot/zhipuai/zhipuai_bot.py", line 15, in <module>
    from zhipuai import ZhipuAI
  File "/usr/lib/python3.9/site-packages/zhipuai/__init__.py", line 2, in <module>
    from ._client import ZhipuAI
  File "/usr/lib/python3.9/site-packages/zhipuai/_client.py", line 7, in <module>
    from .core import _jwt_token
  File "/usr/lib/python3.9/site-packages/zhipuai/core/__init__.py", line 1, in <module>
    from ._base_models import (
  File "/usr/lib/python3.9/site-packages/zhipuai/core/_base_models.py", line 17, in <module>
    from pydantic.fields import FieldInfo
  File "/usr/lib/python3.9/site-packages/pydantic/fields.py", line 17, in <module>
    from pydantic_core import PydanticUndefined
  File "/usr/lib/python3.9/site-packages/pydantic_core/__init__.py", line 6, in <module>
    from ._pydantic_core import (
ModuleNotFoundError: No module named 'pydantic_core._pydantic_core'
@caixinyuan
Copy link
Author

:~/chatgpt-on-wechat# pip3 install zhipuai
Requirement already satisfied: zhipuai in /usr/lib/python3.9/site-packages (2.1.5.20230904)
Requirement already satisfied: cachetools>=4.2.2 in /usr/lib/python3.9/site-packages (from zhipuai) (5.5.0)
Requirement already satisfied: httpx>=0.23.0 in /usr/lib/python3.9/site-packages (from zhipuai) (0.27.2)
Requirement already satisfied: pydantic<3.0,>=1.9.0 in /usr/lib/python3.9/site-packages (from zhipuai) (2.10.2)
Requirement already satisfied: pydantic-core>=2.14.6 in /usr/lib/python3.9/site-packages (from zhipuai) (2.27.1)
Requirement already satisfied: pyjwt<2.9.0,>=2.8.0 in /usr/lib/python3.9/site-packages (from zhipuai) (2.8.0)
Requirement already satisfied: anyio in /usr/lib/python3.9/site-packages (from httpx>=0.23.0->zhipuai) (4.6.2.post1)
Requirement already satisfied: certifi in /usr/lib/python3.9/site-packages (from httpx>=0.23.0->zhipuai) (2021.5.30)
Requirement already satisfied: httpcore==1.* in /usr/lib/python3.9/site-packages (from httpx>=0.23.0->zhipuai) (1.0.7)
Requirement already satisfied: idna in /usr/lib/python3.9/site-packages (from httpx>=0.23.0->zhipuai) (3.2)
Requirement already satisfied: sniffio in /usr/lib/python3.9/site-packages (from httpx>=0.23.0->zhipuai) (1.3.1)
Requirement already satisfied: h11<0.15,>=0.13 in /usr/lib/python3.9/site-packages (from httpcore==1.*->httpx>=0.23.0->zhipuai) (0.14.0)
Requirement already satisfied: annotated-types>=0.6.0 in /usr/lib/python3.9/site-packages (from pydantic<3.0,>=1.9.0->zhipuai) (0.7.0)
Requirement already satisfied: typing-extensions>=4.12.2 in /usr/lib/python3.9/site-packages (from pydantic<3.0,>=1.9.0->zhipuai) (4.12.2)
Requirement already satisfied: exceptiongroup>=1.0.2 in /usr/lib/python3.9/site-packages (from anyio->httpx>=0.23.0->zhipuai) (1.2.2)

@6vision
Copy link
Collaborator

6vision commented Nov 28, 2024

image
python 3.10,zhipuai sdk版本:2.0.1 可以正常使用。
可以安装一下2.0.1版本,

@6vision
Copy link
Collaborator

6vision commented Nov 28, 2024

测试zhipuai sdk版本:2.1.5.20230904 也可以正常回复,可能还是你的python环境有点问题,可以用虚拟环境试试

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

No branches or pull requests

2 participants