Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python pip.\u供应商行为奇怪,但请求有效_Python_Visual Studio Code_Pycharm - Fatal编程技术网

Python pip.\u供应商行为奇怪,但请求有效

Python pip.\u供应商行为奇怪,但请求有效,python,visual-studio-code,pycharm,Python,Visual Studio Code,Pycharm,我在运行代码时遇到问题。我看到以下错误。有趣的是,当我把这段代码带到其他环境中,比如visualcode时,代码正在工作,我得到了响应。。。我认为来自pip的有问题。\u供应商导入pycharm自动添加的请求。例如,在visualcode中,正在添加imports请求,并且可以正常工作。我应该如何执行此代码才能在pycharm中正确运行 TimeoutError: [WinError 10060] A connection attempt failed because the connected

我在运行代码时遇到问题。我看到以下错误。有趣的是,当我把这段代码带到其他环境中,比如
visualcode
时,代码正在工作,我得到了响应。。。我认为来自pip的
有问题。\u供应商导入
pycharm
自动添加的请求。例如,在
visualcode
中,正在添加
imports请求
,并且可以正常工作。我应该如何执行此代码才能在
pycharm
中正确运行

TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed
 to respond

During handling of the above exception, another exception occurred:
 self, "Failed to establish a new connection: %s" % e
pip._vendor.urllib3.exceptions.NewConnectionError: <pip._vendor.urllib3.connection.HTTPSConnection object at 0x00000217D0A2B9C8>: Failed to establish a new connection: [WinError 10060] A connection atte
mpt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
 raise MaxRetryError(_pool, url, error or ResponseError(cause))
pip._vendor.urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='xxx.xxx', port=443): Max retries exceeded with url: /api/ser (Caused by NewConnectionError('<pip._vend
or.urllib3.connection.HTTPSConnection object at 0x00000217D0A2B9C8>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respo
nd after a period of time, or established connection failed because connected host has failed to respond'))

您正在导入
\u供应商
导入您的
pip
库。它可以工作,但您可以只执行导入请求(如果已安装)。

如果它也可以通过CLI工作,请注意防火墙/防病毒设置。
from pip._vendor import requests


if __name__ == '__main__':
    print(msg)

    data = {
        "Ex": 22
        }
    }

    headers = {
        "Authorization": "Bearer xxxx"
    }

    response = requests.post("https://xxx.xxx/api/ser", headers=headers, json=data)

    print(response.json())