创建 reddit 对象时出现此错误。这是代码:
import praw, requests, ctypes
r = praw.Reddit(user_agent="Wallpaper downloader")
这是错误:
回溯(最近一次通话最后):
File "C:/Python27/background.py", line 3, in <module>
r = praw.Reddit(user_agent="Wallpaper downloader")
File "C:\Python27\lib\site-packages\praw\__init__.py", line 1028, in __init__
super(AuthenticatedReddit, self).__init__(*args, **kwargs)
File "C:\Python27\lib\site-packages\praw\__init__.py", line 502, in __init__
super(OAuth2Reddit, self).__init__(*args, **kwargs)
File "C:\Python27\lib\site-packages\praw\__init__.py", line 615, in __init__
super(UnauthenticatedReddit, self).__init__(*args, **kwargs)
File "C:\Python27\lib\site-packages\praw\__init__.py", line 280, in __init__
self.handler = handler or DefaultHandler()
File "C:\Python27\lib\site-packages\praw\handlers.py", line 70, in __init__
self.http = Session() # Each instance should have its own session
File "C:\Python27\lib\site-packages\requests\sessions.py", line 176, in __init__
self.headers = default_headers()
File "C:\Python27\lib\site-packages\requests\utils.py", line 461, in default_headers
'User-Agent': default_user_agent(),
File "C:\Python27\lib\site-packages\requests\utils.py", line 430, in default_user_agent
_implementation = platform.python_implementation()
File "C:\Python27\lib\platform.py", line 1458, in python_implementation
return _sys_version()[0]
File "C:\Python27\lib\platform.py", line 1423, in _sys_version
repr(sys_version))
ValueError: failed to parse CPython sys.version: '2.7.3 |EPD_free 7.3-2 (32-bit)| (default, Apr 12 2012, 14:30:37) [MSC v.1500 32 bit (Intel)]'
我使用 pip 安装了 praw,并且我使用的是 Windows。知道为什么我会收到此错误吗?