1 个回答

这个啊,我来示范一个给你看看

>>> import requests 
>>> requests("123")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'module' object is not callable
>>> 
>>> from os import path
>>> path()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'module' object is not callable

看明白了吧,我导入的是requests、path都是模块,我当方法用了,就报这个错了,我应该这样用才对

>>> import requests
>>> requests.get("http://baidu.com")
<Response [200]>

调用模块中的方法,你看看你的是不是这样。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题