为什么当我运行
时,为什么不断收到此“ TypeError: init ()收到意外的关键字参数'strict'”res = requests.get('https://automatetheboringstuff.com/files/rj.txt')
Traceback (most recent call last):
File "<stdin>", line 1, in <module
>
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\api.py", line 49, in get
return request('get', url, **kwargs)
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\api.py", line 38, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 232, in _get_conn
return conn or self._new_conn()
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 199, in _new_conn
strict=self.strict)
TypeError: __init__() got an unexpected keyword argument 'strict'
答案 0 :(得分:0)
解决方案是使用最新版本的请求:)