【发布时间】:2015-08-18 23:12:21
【问题描述】:
我想使用模块'requests',但是,安装后,即使导入也无法正常工作:
Python 2.7.10 (v2.7.10:15c95b7d81dc, May 23 2015, 09:33:12)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "requests.py", line 20, in <module>
r = requests.post(url, data=json.dumps(payload), headers=headers)
AttributeError: 'module' object has no attribute 'post'
有什么线索吗?
【问题讨论】:
-
有没有可能是您在下载的包目录中,并且您正在尝试导入已卸载的模块?
标签: python macos import module python-requests