python报错:AttributeError: module ‘json‘ has no attribute ‘dumps‘

报错原因:我新建了一个json 文件夹模块,改掉名字就好了

Traceback (most recent call last):
  File "/home/caoyf/code/ovirt-ovn-api/ovn/network/post_network.py", line 11, in 
    timeout=30
  File "/home/caoyf/.python_env/start/lib/python3.6/site-packages/requests/api.py", line 116, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/home/caoyf/.python_env/start/lib/python3.6/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/caoyf/.python_env/start/lib/python3.6/site-packages/requests/sessions.py", line 519, in request
    prep = self.prepare_request(req)
  File "/home/caoyf/.python_env/start/lib/python3.6/site-packages/requests/sessions.py", line 462, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "/home/caoyf/.python_env/start/lib/python3.6/site-packages/requests/models.py", line 316, in prepare
    self.prepare_body(data, files, json)
  File "/home/caoyf/.python_env/start/lib/python3.6/site-packages/requests/models.py", line 466, in prepare_body
    body = complexjson.dumps(json)
AttributeError: module 'json' has no attribute 'dumps'

python报错:AttributeError: module ‘json‘ has no attribute ‘dumps‘_第1张图片

 

你可能感兴趣的:(python,python,json,dumps,AttributeError)