V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
sindri
V2EX  ›  Python

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

  •  
  •   sindri · 2019-07-30 21:04:00 +08:00 · 11884 次点击
    这是一个创建于 1702 天前的主题,其中的信息可能已经有所发展或是发生改变。

    刚入门 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>

    14 条回复    2019-07-31 21:38:33 +08:00
    sindri
        1
    sindri  
    OP
       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
        2
    sindri  
    OP
       2019-07-30 21:07:13 +08:00
    扫码后,微信为什么登陆不了?我单独登陆 web wechat 倒是可以登陆。
    sindri
        3
    sindri  
    OP
       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
        4
    ganyouxuan  
       2019-07-30 22:46:35 +08:00 via Android   ❤️ 1
    直接访问微信网页版登录看看
    E520
        5
    E520  
       2019-07-30 22:51:11 +08:00 via Android
    新号都是登不上的
    20150517
        6
    20150517  
       2019-07-30 23:00:49 +08:00
    2018 年以后的号全不可以使用网页版
    sindri
        7
    sindri  
    OP
       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
        8
    20150517  
       2019-07-30 23:35:18 +08:00   ❤️ 1
    如果腾迅发现你用第三方,老号也有可能被禁用 itchat 的
    leishi1313
        9
    leishi1313  
       2019-07-31 07:47:37 +08:00   ❤️ 1
    @sindri 看你的错误是腾讯报的也不是 itchat 或者 python 的问题,这种情况要么找其他能用的,要么自己研究怎么继续用,其他的基本上帮不上什么忙
    Fx8m
        10
    Fx8m  
       2019-07-31 09:09:32 +08:00   ❤️ 1
    1203 為了你的帳戶安全,此 WeChat ID 不能登入 WeChat 網頁版。你可以使用 WeChat for Windows 或 WeChat for Mac 在電腦端登入

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

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

    只有选择其他的路
    leishi1313
        13
    leishi1313  
       2019-07-31 12:03:35 +08:00   ❤️ 1
    @sindri github.com/LeiShi1313/wechit 试试这个吧,fork 别人的,改了两行现在能用了,你要能自己用还得改不少,但是这个思路应该没问题
    sindri
        14
    sindri  
    OP
       2019-07-31 21:38:33 +08:00
    @leishi1313 谢谢,我去试试。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   4572 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 10:06 · PVG 18:06 · LAX 03:06 · JFK 06:06
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.