![](/img/trans.png)
[英]Python - TypeError: super(type, obj): obj must be an instance or subtype of type?
[英]Requests.get('url') is returning TypeError super(type, obj): obj must be an instance or subtype of type
我正在學習如何在python3中使用JSON(特別是在anaconda中工作),並且我試圖運行此代碼段:
import requests
import json
response = json.loads(requests.get("https://jsonplaceholder.typicode.com/todos").text)
但我不斷收到此錯誤:
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
我似乎無法弄清楚為什么會這樣。 我對此很陌生-感謝您的幫助。
編輯:所以我在不同的IDE上運行了它,但它仍然有效,但是它仍然拒絕Spyder ...
我只需要重新啟動我的IDE ...謝謝大家!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.