JustUndertaker / ComWeChatBotClient

基于COM通信的微信pc hook应用端,支持Onebot12协议
https://justundertaker.github.io/ComWeChatBotClient/
GNU Affero General Public License v3.0
272 stars 55 forks source link

ImportError: cannot import name 'ParamSpec' from 'typing' #49

Closed systelbbbb closed 8 months ago

systelbbbb commented 8 months ago

Traceback (most recent call last): File "D:\PJ\wxhook\ComWeChatBotClient-0.0.8\main.py", line 1, in import wechatbot_client File "D:\PJ\wxhook\ComWeChatBotClient-0.0.8\wechatbot_client__init.py", line 8, in from wechatbot_client.wechat import WeChatManager File "D:\PJ\wxhook\ComWeChatBotClient-0.0.8\wechatbot_client\wechat__init__.py", line 7, in from .wechat import WeChatManager as WeChatManager File "D:\PJ\wxhook\ComWeChatBotClient-0.0.8\wechatbot_client\wechat\wechat.py", line 7, in from wechatbot_client.action_manager import ( File "D:\PJ\wxhook\ComWeChatBotClient-0.0.8\wechatbot_client\action_manager\init__.py", line 4, in from .check import check_action_params as check_action_params File "D:\PJ\wxhook\ComWeChatBotClient-0.0.8\wechatbot_client\action_manager\check.py", line 6, in from typing import Callable, ParamSpec, Type, TypeVar ImportError: cannot import name 'ParamSpec' from 'typing' (D:\Programs\Python\Python39\lib\typing.py)

帮忙看看,我安装了这个模块的呀

Lilneo786 commented 8 months ago

The error message you're encountering suggests that there is an issue with the ParamSpec import from the typing module in your code. The ParamSpec class is introduced in Python 3.10, so if you are using Python versions earlier than 3.10, you will encounter this error.

You can either upgrade to Python 3.10

OR

Modify the code:

from typing import Callable, Type, TypeVar

systelbbbb commented 8 months ago

The error message you're encountering suggests that there is an issue with the ParamSpec import from the typing module in your code. The ParamSpec class is introduced in Python 3.10, so if you are using Python versions earlier than 3.10, you will encounter this error.

You can either upgrade to Python 3.10

OR

Modify the code:

from typing import Callable, Type, TypeVar

Thank you very much, I didn't get any error after upgrading to 3.10.