raceback (most recent call last): File "D:\Program Files\JetBrains\PyCharm 2020.1\plugins\python\helpers\pydev\_pydevd_bundle\pydevd_exec2.py", line 3, in Exec exec(exp, global_vars, local_vars) File "<input>", line 1, in <module> File "<string>", line 75, in CreateNewCustomeByRequestsPOST File "C:\ProgramData\Anaconda3\envs\env_cv2_cp38\lib\site-packages\requests\api.py", line 115, in post return request("post", url, data=data, json=json, **kwargs) File "C:\ProgramData\Anaconda3\envs\env_cv2_cp38\lib\site-packages\requests\api.py", line 59, in request return session.request(method=method, url=url, **kwargs) File "C:\ProgramData\Anaconda3\envs\env_cv2_cp38\lib\site-packages\requests\sessions.py", line 573, in request prep = self.prepare_request(req) File "C:\ProgramData\Anaconda3\envs\env_cv2_cp38\lib\site-packages\requests\sessions.py", line 471, in prepare_request cookies = cookiejar_from_dict(cookies) File "C:\ProgramData\Anaconda3\envs\env_cv2_cp38\lib\site-packages\requests\cookies.py", line 537, in cookiejar_from_dict cookiejar.set_cookie(create_cookie(name, cookie_dict[name])) TypeError: list indices must be integers or slices, not dict
时间: 2023-06-30 11:10:22 浏览: 934
PyCharm2020.1.2社区版安装,配置及使用教程详解(Windows)
这是一个 Python 的错误提示,看起来你在使用 requests 库的 post 方法的时候传入了一个字典格式的参数,但是该参数在某个键值上不是字符串类型而是列表类型,导致出现了 TypeError: list indices must be integers or slices, not dict 的错误。建议你检查一下传入的参数,特别是对于该字典中每个键对应的值的类型是否正确。
阅读全文