zhayujie / bot-on-anything

Connect AI models (like ChatGPT-3.5/4.0, Baidu Yiyan, New Bing, Bard) to apps (like Wechat, public account, DingTalk, Telegram, QQ). 将 ChatGPT、必应、文心一言、谷歌Bard 等对话模型连接各类应用,如微信、公众号、QQ、Telegram、Gmail、Slack、Web、企业微信、飞书、钉钉等。
MIT License
3.93k stars 914 forks source link

企业微信API设置无法保存 #306

Closed ck7968 closed 1 year ago

ck7968 commented 1 year ago

提示openapi回调地址请求不通过 服务器这边报错:[2023-04-13 16:07:31,266] ERROR in app: Exception on /wechat [GET] Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2528, in wsgi_app response = self.full_dispatch_request() File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1825, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1823, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1799, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File "/root/bot-on-anything/channel/wechat/wechat_com_channel.py", line 27, in handler_msg return WechatEnterpriseChannel().handle() File "/root/bot-on-anything/channel/wechat/wechat_com_channel.py", line 72, in handle echostr = self.crypto.check_signature(signature, timestamp, nonce, echostr) File "/usr/local/lib/python3.8/dist-packages/wechatpy/enterprise/crypto.py", line 23, in check_signature return self._check_signature( File "/usr/local/lib/python3.8/dist-packages/wechatpy/crypto/init.py", line 60, in _check_signature pc = crypto_class(self.key) File "/usr/local/lib/python3.8/dist-packages/wechatpy/crypto/base.py", line 21, in init self.cipher = WeChatCipher(key) File "/usr/local/lib/python3.8/dist-packages/wechatpy/crypto/cryptography.py", line 25, in init Cipher( TypeError: init() missing 1 required positional argument: 'backend'

OliverSunWH commented 1 year ago

我也遇到这个问题了,请问楼主解决了吗,求救!我的wx:swh526473035

rickylin047 commented 1 year ago

应该是你机器上的cryptography包是旧版的,旧版的cryptography的这个类的初始化backend参数是必须传入的,新版的是optional的。

pip install cryptography==35.0.0

ck7968 commented 1 year ago

应该是你机器上的cryptography包是旧版的,旧版的cryptography的这个类的初始化backend参数是必须传入的,新版的是optional的。

pip install cryptography==35.0.0

解决了,谢谢!