安装 itchat 的时候,扫码后就是登陆不了。

2019-07-30 21:04:00 +08:00
 sindri

刚入门 python,想利用搜索编程。

目的是,用 Python 把 EXCEL 里同的数据导出来,生成图片,自动用微信发给相关人士。

想不到安装 itchat 的时候,遇到了问题。

求大佬帮忙指点一二。谢谢!

----------错误如下:-----------------

import itchat itchat.auto_login() Getting uuid of QR code. Downloading QR code. Please scan the QR code to log in. Please press confirm on your phone. Loading the contact, this may take a little while. Traceback (most recent call last): File "<pyshell#2>", line 1, in <module> itchat.auto_login() File "G:\Python34\lib\site-packages\itchat\components\register.py", line 35, in auto_login loginCallback=loginCallback, exitCallback=exitCallback) File "G:\Python34\lib\site-packages\itchat\components\login.py", line 66, in login self.show_mobile_login() File "G:\Python34\lib\site-packages\itchat\components\login.py", line 212, in show_mobile_login self.loginInfo['url'], self.loginInfo['pass_ticket']) KeyError: 'pass_ticket' ------------------错误结束-------------------</module>

11919 次点击
所在节点    Python
14 条回复
sindri
2019-07-30 21:05:32 +08:00
代码格式咋变成这样了。再帖一下:
>>> import itchat
>>> itchat.auto_login()
Getting uuid of QR code.
Downloading QR code.
Please scan the QR code to log in.
Please press confirm on your phone.
Loading the contact, this may take a little while.
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
itchat.auto_login()
File "G:\Python34\lib\site-packages\itchat\components\register.py", line 35, in auto_login
loginCallback=loginCallback, exitCallback=exitCallback)
File "G:\Python34\lib\site-packages\itchat\components\login.py", line 66, in login
self.show_mobile_login()
File "G:\Python34\lib\site-packages\itchat\components\login.py", line 212, in show_mobile_login
self.loginInfo['url'], self.loginInfo['pass_ticket'])
KeyError: 'pass_ticket'
>>>
sindri
2019-07-30 21:07:13 +08:00
扫码后,微信为什么登陆不了?我单独登陆 web wechat 倒是可以登陆。
sindri
2019-07-30 22:25:42 +08:00
继续用 wxpy 模块,也是出现问题:

>>> from wxpy import *
>>> bot =Bot()
Getting uuid of QR code.
Downloading QR code.
Please scan the QR code to log in.
Please press confirm on your phone.
Loading the contact, this may take a little while.

Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
bot =Bot()
ganyouxuan
2019-07-30 22:46:35 +08:00
直接访问微信网页版登录看看
E520
2019-07-30 22:51:11 +08:00
新号都是登不上的
20150517
2019-07-30 23:00:49 +08:00
2018 年以后的号全不可以使用网页版
sindri
2019-07-30 23:17:29 +08:00
@ganyouxuan 直接登陆了网页版,是可以登陆网页版的。但是对程序没啥用。

@E520 不是新号,是老号。

@20150517 不是新号,是老号。

卸载了 itchat, pip uninstall itchat,又重新安装了它。结果出现:
>>> import itchat


>>> itchat.auto_login()
Getting uuid of QR code.
Downloading QR code.
Please scan the QR code to log in.
Please press confirm on your phone.
Your wechat account may be LIMITED to log in WEB wechat, error info:
<error><ret>1203</ret><message>為了你的帳戶安全,此 WeChat ID 不能登入 WeChat 網頁版。你可以使用 WeChat for Windows 或 WeChat for Mac 在電腦端登入。WeChat for Windows 下載網址: https://pc.weixin.qq.com ; WeChat for Mac 下載網址: https://mac.weixin.qq.com</message></error>
20150517
2019-07-30 23:35:18 +08:00
如果腾迅发现你用第三方,老号也有可能被禁用 itchat 的
leishi1313
2019-07-31 07:47:37 +08:00
@sindri 看你的错误是腾讯报的也不是 itchat 或者 python 的问题,这种情况要么找其他能用的,要么自己研究怎么继续用,其他的基本上帮不上什么忙
Fx8m
2019-07-31 09:09:32 +08:00
1203 為了你的帳戶安全,此 WeChat ID 不能登入 WeChat 網頁版。你可以使用 WeChat for Windows 或 WeChat for Mac 在電腦端登入

很明显是你微信号不允许登录 web 微信啊
sindri
2019-07-31 10:49:48 +08:00
@20150517
@leishi1313
@Fx8m
谢谢啦,换了电脑,换了系统,继续试,还是出现 7 楼的问题。看来我得换一种方式去 python 登陆微信了。

求大佬支个招,如何才能 python 登陆微信发消息。谢谢啦。
Fx8m
2019-07-31 10:57:04 +08:00
和你电脑、系统无关。1203 就是不允许登录 web 微信。

只有选择其他的路
leishi1313
2019-07-31 12:03:35 +08:00
@sindri github.com/LeiShi1313/wechit 试试这个吧,fork 别人的,改了两行现在能用了,你要能自己用还得改不少,但是这个思路应该没问题
sindri
2019-07-31 21:38:33 +08:00
@leishi1313 谢谢,我去试试。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/587648

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX