烦!!! 发表于 2020-7-22 22:57:25

requests模块安装不上

Python3.73requests模块安装失败怎么办???

Twilight6 发表于 2020-7-22 22:58:13




不知道你的报错失败内容,就没办法解决


烦!!! 发表于 2020-7-22 23:06:46

Twilight6 发表于 2020-7-22 22:58
不知道你的报错失败内容,就没办法解决

Traceback (most recent call last):
File "C:\Hard_python\robot的大致样子未完成.py", line 27, in <module>
    order.tianqi('郑州')
File "C:\Hard_python\order.py", line 23, in tianqi
    import requests
ModuleNotFoundError: No module named 'requests'

Twilight6 发表于 2020-7-22 23:08:03

烦!!! 发表于 2020-7-22 23:06
Traceback (most recent call last):
File "C:\Hard_python\robot的大致样子未完成.py", line 27, in...



....这个是你没安装 requests 模块的报错,我们要知道的是你去 pip 安装 requests 失败的报错

烦!!! 发表于 2020-7-22 23:11:19

Twilight6 发表于 2020-7-22 23:08
....这个是你没安装 requests 模块的报错,我们要知道的是你去 pip 安装 requests 失败的报错

我安装不上

烦!!! 发表于 2020-7-22 23:13:07

烦!!! 发表于 2020-7-22 23:11
我安装不上

我在命令行窗口敲了python -m pip install requests

Twilight6 发表于 2020-7-22 23:14:23

烦!!! 发表于 2020-7-22 23:13
我在命令行窗口敲了python -m pip install requests

去终端输入这个试试看:

python -m pip install requests -i https://pypi.tuna.tsinghua.edu.cn/simple

如果终端报错,把错误内容发上来

烦!!! 发表于 2020-7-22 23:19:50

Twilight6 发表于 2020-7-22 23:14
去终端输入这个试试看:




Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 677, in urlopen
    chunked=chunked,
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 426, in _make_request
    six.raise_from(e, None)
File "<string>", line 3, in raise_from
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 421, in _make_request
    httplib_response = conn.getresponse()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\http\client.py", line 1321, in getresponse
    response.begin()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\http\client.py", line 296, in begin
    version, status, reason = self._read_status()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\http\client.py", line 265, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\adapters.py", line 449, in send
    timeout=timeout
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 725, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\util\retry.py", line 439, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=65419): Max retries exceeded with url: http://t.weather.sojson.com/api/weather/city/101180101 (Caused by ProxyError('Cannot connect to proxy.', RemoteDisconnected('Remote end closed connection without response')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Hard_python\robot的大致样子未完成.py", line 27, in <module>
    order.tianqi('郑州')
File "C:\Hard_python\order.py", line 24, in tianqi
    res = requests.get(url)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\api.py", line 76, in get
    return request('get', url, params=params, **kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\sessions.py", line 530, in request
    resp = self.send(prep, **send_kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\sessions.py", line 643, in send
    r = adapter.send(request, **kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\adapters.py", line 510, in send
    raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPConnectionPool(host='127.0.0.1', port=65419): Max retries exceeded with url: http://t.weather.sojson.com/api/weather/city/101180101 (Caused by ProxyError('Cannot connect to proxy.', RemoteDisconnected('Remote end closed connection without response')))
>>>

烦!!! 发表于 2020-7-22 23:21:14

Twilight6 发表于 2020-7-22 23:14
去终端输入这个试试看:




安上了,终端没报错
页: [1]
查看完整版本: requests模块安装不上