[英]Requests.get('url') is returning TypeError super(type, obj): obj must be an instance or subtype of type
I'm learning how to work with JSON in python3 (specifically working in anaconda) and I've trying to run this snippet: 我正在学习如何在python3中使用JSON(特别是在anaconda中工作),并且我试图运行此代码段:
import requests
import json
response = json.loads(requests.get("https://jsonplaceholder.typicode.com/todos").text)
but I keep getting this error: 但我不断收到此错误:
Traceback (most recent call last):
File "<ipython-input-54-4ad14477a807>", line 1, in <module>
response = json.loads(requests.get("https://jsonplaceholder.typicode.com/todos").text)
File "C:\Users\ivan.sheng\AppData\Local\Continuum\anaconda3\lib\site-packages\requests\api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "C:\Users\ivan.sheng\AppData\Local\Continuum\anaconda3\lib\site-packages\requests\api.py", line 59, in request
with sessions.Session() as session:
File "C:\Users\ivan.sheng\AppData\Local\Continuum\anaconda3\lib\site-packages\requests\sessions.py", line 417, in __init__
self.mount('https://', HTTPAdapter())
File "C:\Users\ivan.sheng\AppData\Local\Continuum\anaconda3\lib\site-packages\requests\adapters.py", line 123, in __init__
super(HTTPAdapter, self).__init__()
TypeError: super(type, obj): obj must be an instance or subtype of type
I can't seem to figure out why this happens. 我似乎无法弄清楚为什么会这样。 I'm sort of new to this - thanks for the help. 我对此很陌生-感谢您的帮助。
edit: so I ran this on a different IDE and it worked, but it still refuses to work Spyder... 编辑:所以我在不同的IDE上运行了它,但它仍然有效,但是它仍然拒绝Spyder ...
我只需要重新启动我的IDE ...谢谢大家!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.