我刚刚使用'easy_insatll'安装了Requests模块,我试图运行这个tutrorial的演示代码,
import requests
payload = {'username': 'xxxx', 'password': 'xxxxx'}
r = requests.get('https://github.com/timeline.json')
Run Code Online (Sandbox Code Playgroud)
但我得到这个错误:AttributeError: easy_install
任何的想法?谢谢
我有一个Python脚本只有这两行:
import requests
print len(dir(requests))
Run Code Online (Sandbox Code Playgroud)
它打印:
12
48
Run Code Online (Sandbox Code Playgroud)
当我打印实际列表时dir(requests),我得到了这个:
['__author__', '__build__', '__builtins__', '__copyright__', '__doc__', '__file__', '__license__', '__name__', '__package__', '__path__', '__title__', '__version__']
['ConnectionError', 'HTTPError', 'NullHandler', 'PreparedRequest', 'Request', 'RequestException', 'Response', 'Session', 'Timeout', 'TooManyRedirects', 'URLRequired', '__author__', '__build__', '__builtins__', '__copyright__', '__doc__', '__file__', '__license__', '__name__', '__package__', '__path__', '__title__', '__version__', 'adapters', 'api', 'auth', 'certs', 'codes', 'compat', 'cookies', 'delete', 'exceptions', 'get', 'head', 'hooks', 'logging', 'models', 'options', 'packages', 'patch', 'post', 'put', 'request', 'session', 'sessions', 'status_codes', 'structures', 'utils']
Run Code Online (Sandbox Code Playgroud)
我猜有多个requests模块或类似的东西.请帮忙.