wxpy
wxpy copied to clipboard
python2.7 FileNotFoundError
使用python2.7 运行bot = Bot()
报错
File "/Users/alfred_yuan/git/shark-robot/weixin_robot/run.py", line 11, in main
bot = Bot(console_qr=True)
File "/Users/alfred_yuan/git/shark-robot/shark-venv/lib/python2.7/site-packages/wxpy/api/bot.py", line 88, in __init__
except FileNotFoundError as e:
NameError: global name 'FileNotFoundError' is not defined
python2 里面并没有FileNotFoundError。应该改成IOError会更好点
我也碰到了同样的问题,昨天还是可以正常运行的,代码哪都没改今天再运行就提示:
E:\Python27\python.exe D:/wxpyTest/src/test.py
Getting uuid of QR code.
Downloading QR code.
Please scan the QR code to log in.
Please press confirm on your phone.
Traceback (most recent call last):
File "D:/wxpyTest/src/test.py", line 5, in
Process finished with exit code 1
我也遇到这种问题然后也无法登录微信web端,是被封了吗
我换成Python 3试了下,报错提示变成了 KeyError: 'pass_ticket'。 从其它回答中看到了相同问题,这种情况确实是被封了。
可以试一试:bot = Bot(console_qr=True)
可以试一试:bot = Bot(console_qr=True)
加上参数还是报错
Traceback (most recent call last):
File "/Users/penny/PycharmProjects/wxpyDemo/wxBot.py", line 13, in
可以试一试:bot = Bot(console_qr=True) 亲测可以,应该是因为当前系统没法显示二维码造成的
Linux centos 7
3.10.0-514.26.2.el7.x86_64
Traceback (most recent call last):
File "test.py", line 4, in
In [4]: bot = Bot()
Getting uuid of QR code.
Downloading QR code.
Please scan the QR code to log in.
Please press confirm on your phone.
#---------------------------------------------------------------------------
NameError Traceback (most recent call last)
c:\users\xxx.virtualenvs\pywechat-g3i5pea4\lib\site-packages\wxpy\api\bot.pyc in init(self, cache_path, console_qr, qr_path, qr_callback, login_callback, logout_callback)
86 loginCallback=login_callback, exitCallback=logout_callback
87 )
---> 88 except FileNotFoundError as e:
89 if 'xdg-open' in e.strerror:
90 raise Exception('use console_qr
arg while under pure console environment')
NameError: global name 'FileNotFoundError' is not defined
这个问题怎么解决呀!! 我登陆了一次,然后 bot.logout() ,再进行bot=Bot() 就报错了。ISSUE 挂着好几个月了呀!有人解决了么?
In [4]: bot = Bot() Getting uuid of QR code. Downloading QR code. Please scan the QR code to log in. Please press confirm on your phone. #--------------------------------------------------------------------------- NameError Traceback (most recent call last) in () ----> 1 bot = Bot()
c:\users\xxx.virtualenvs\pywechat-g3i5pea4\lib\site-packages\wxpy\api\bot.pyc in init(self, cache_path, console_qr, qr_path, qr_callback, login_callback, logout_callback) 86 loginCallback=login_callback, exitCallback=logout_callback 87 ) ---> 88 except FileNotFoundError as e: 89 if 'xdg-open' in e.strerror: 90 raise Exception('use
console_qr
arg while under pure console environment')NameError: global name 'FileNotFoundError' is not defined
这个问题怎么解决呀!! 我登陆了一次,然后 bot.logout() ,再进行bot=Bot() 就报错了。ISSUE 挂着好几个月了呀!有人解决了么?
经过实践,证明所有的Bot都被微信给屏蔽了。
bot = Bot(console_qr=True)出现二维码,就是二维码太大了