ItChat icon indicating copy to clipboard operation
ItChat copied to clipboard

服务器端无法登录

Open Lee66 opened this issue 6 years ago • 2 comments

[root@VM_0_16_centos py]# python wechat.py 
Getting uuid of QR code.
Downloading QR code.
Traceback (most recent call last):
  File "wechat.py", line 22, in <module>
    itchat.auto_login()
  File "/usr/lib/python2.7/site-packages/itchat/components/register.py", line 36, in auto_login
    loginCallback=loginCallback, exitCallback=exitCallback)
  File "/usr/lib/python2.7/site-packages/itchat/components/login.py", line 49, in login
    picDir=picDir, qrCallback=qrCallback)
  File "/usr/lib/python2.7/site-packages/itchat/components/login.py", line 123, in get_QR
    utils.print_qr(picDir)
  File "/usr/lib/python2.7/site-packages/itchat/utils.py", line 83, in print_qr
    subprocess.call(['xdg-open', fileDir])
  File "/usr/lib64/python2.7/subprocess.py", line 524, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

itchat版本为:[1.3.10]

Lee66 avatar Jun 02 '19 16:06 Lee66

@Lee66 用 itchat.auto_login(enableCmdQR=2) 不用itchat.auto_login() 即可解决

gaozp avatar Jun 13 '19 01:06 gaozp

你在linux下自然是没法弹出图形化的图片呀。。。和楼上一样,改用命令行的二维码就行了itchat.auto_login(enableCmdQR=True),=2是最小像素为2字节,自己试用一下就明白了

htyangya avatar Jul 27 '19 07:07 htyangya