Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

下载图片时出错? #44

Open
minkoonim opened this issue Apr 21, 2018 · 1 comment
Open

下载图片时出错? #44

minkoonim opened this issue Apr 21, 2018 · 1 comment

Comments

@minkoonim
Copy link

minkoonim commented Apr 21, 2018

脚本里有
file=itchatmp.messages.download(msg['MediaId']),
收到图片时会发生下面的错误。
在 Python2.7 是没问题的,
出问题是在3.5.5。
有人知道解决方法吗

在附上我的 requirements.txt

File "/root/anaconda3/envs/itchatmp/lib/python3.5/site-packages/itchatmp/components/register.py", line 56, in sync_post_fn
reply = reply_fn(copy.deepcopy(msgDict))
File "app.py", line 143, in img_reply
file=itchatmp.messages.download(msg['MediaId'])
File "/root/anaconda3/envs/itchatmp/lib/python3.5/site-packages/itchatmp/controllers/messages.py", line 38, in download
mediaId)

File "/root/anaconda3/envs/itchatmp/lib/python3.5/site-packages/itchatmp/controllers/common.py", line 19, in determine_wrapper
**return mpFn(*args, kwargs)
File "/root/anaconda3/envs/itchatmp/lib/python3.5/site-packages/itchatmp/controllers/mpapi/base/common.py", line 147, in __access_token
updateResult = tokenFn()

File "/root/anaconda3/envs/itchatmp/lib/python3.5/site-packages/itchatmp/controllers/mpapi/base/common.py", line 80, in _update_access_token
r = ReturnValue(r)

File "/root/anaconda3/envs/itchatmp/lib/python3.5/site-packages/itchatmp/returnvalues.py", line 30, in init
Future.init(self)
File "/root/anaconda3/envs/itchatmp/lib/python3.5/asyncio/futures.py", line 169, in init
self._loop = events.get_event_loop()

File "/root/anaconda3/envs/itchatmp/lib/python3.5/asyncio/events.py", line 678, in get_event_loop
return get_event_loop_policy().get_event_loop()

File "/root/anaconda3/envs/itchatmp/lib/python3.5/asyncio/events.py", line 584, in get_event_loop
% threading.current_thread().name)

RuntimeError: There is no current event loop in thread 'Thread-9'.

asn1crypto==0.24.0
certifi==2018.4.16
cffi==1.11.5
chardet==3.0.4
cryptography==2.2.2
future==0.16.0
futures==3.1.1
idna==2.6
itchatmp==0.0.17
Pillow==5.1.0
pycparser==2.18
pylibmc==1.5.2
PyMySQL==0.8.0
python-memcached==1.59
pyzbar==0.1.5
requests==2.18.4
six==1.11.0
tornado==5.0.2
urllib3==1.22

$ pip install itchatmp
Requirement already satisfied: itchatmp in /python3.5/site-packages (0.0.17)
Requirement already satisfied: futures in /python3.5/site-packages (from itchatmp) (3.1.1)
Requirement already satisfied: tornado in /python3.5/site-packages (from itchatmp) (5.0.2)
Requirement already satisfied: cryptography in /python3.5/site-packages (from itchatmp) (2.2.2)
Requirement already satisfied: requests in /python3.5/site-packages (from itchatmp) (2.18.4)
Requirement already satisfied: six>=1.4.1 in /python3.5/site-packages (from cryptography->itchatmp) (1.11.0)
Requirement already satisfied: asn1crypto>=0.21.0 in /python3.5/site-packages (from cryptography->itchatmp) (0.24.0)
Requirement already satisfied: cffi>=1.7; platform_python_implementation != "PyPy" in /python3.5/site-packages (from cryptography->itchatmp) (1.11.5)
Requirement already satisfied: idna>=2.1 in /python3.5/site-packages (from cryptography->itchatmp) (2.6)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /python3.5/site-packages (from requests->itchatmp) (3.0.4)
Requirement already satisfied: certifi>=2017.4.17 in /python3.5/site-packages (from requests->itchatmp) (2018.4.16)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in /python3.5/site-packages (from requests->itchatmp) (1.22)
Requirement already satisfied: pycparser in /python3.5/site-packages (from cffi>=1.7; platform_python_implementation != "PyPy"->cryptography->itchatmp) (2.18)

@minkoonim
Copy link
Author

我想过把脚本从头到底改成 python2.7的样子,
可是应该怪我入门就学 python3。。
实在改不来啊 各种错误

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant