requests.exceptions.ConnectionError: HTTPConnectionPool(host=‘127.0.0.1‘, port=8000)

在用PyCharm跑网络通信程序时,出现下面的报错:
requests.exceptions.ConnectionError: HTTPConnectionPool(host=‘127.0.0.1’, port=8000): Max retries exceeded with url: / (Caused by NewConnectionError(’: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。’,))

这种情况有可能是因为端口被占用的缘故,可以修改端口号,然后运行就可以了

你可能感兴趣的:(pycharm,python)