简体   繁体   English

Requests.get('url')返回TypeError super(type,obj):obj必须是类型的实例或子类型

[英]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.

相关问题 Python - TypeError: super(type, obj): obj must be an instance or subtype of type? - Python - TypeError: super(type, obj): obj must be an instance or subtype of type? 为什么 Super() 返回 TypeError: super(type, obj): obj must be an instance or subtype of type - Why does Super() return TypeError: super(type, obj): obj must be an instance or subtype of type super(type, obj):obj 必须是类型的实例或子类型 - super(type, obj): obj must be an instance or subtype of type Azure事件中心-TypeError:super(type,obj):obj必须是类型的实例或子类型 - Azure event hub - TypeError: super(type, obj): obj must be an instance or subtype of type autoreload和package导致TypeError:super(type,obj):obj必须是类型的实例或子类型 - autoreload and package causing TypeError: super(type, obj): obj must be an instance or subtype of type class 基于视图 -TypeError: super(type, obj): obj must be an instance or subtype of type - class based views -TypeError: super(type, obj): obj must be an instance or subtype of type 在子 class 中调用 @classmethod 给出“TypeError: super(type, obj): obj must be an instance or subtype of type” - Calling a @classmethod in a child class give a 'TypeError: super(type, obj): obj must be an instance or subtype of type' 模拟__init __(self,…):TypeError:super(type,obj):obj必须是类型的实例或子类型 - mock __init__(self, …): TypeError: super(type, obj): obj must be an instance or subtype of type TypeError: super(type, obj): obj 必须是类型的实例或子类型,仅当我的元类被导入时 - TypeError: super(type, obj): obj must be an instance or subtype of type ONLY when my metaclass is imported TypeError: super(type, obj): obj 必须是类型的实例或子类型。 创建元类后调用 super 时出错 - TypeError: super(type, obj): obj must be an instance or subtype of type. Error when calling super after metaclass creation
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM