8.15K 浏览
0

Traceback (most recent call last):
File “E:\Anaconda3\lib\site-packages\urllib3\connection.py”, line 159, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw)
File “E:\Anaconda3\lib\site-packages\urllib3\util\connection.py”, line 80, in create_connection
raise err
File “E:\Anaconda3\lib\site-packages\urllib3\util\connection.py”, line 70, in create_connection
sock.connect(sa)
ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “E:\Anaconda3\lib\site-packages\urllib3\connectionpool.py”, line 600, in urlopen
chunked=chunked)
File “E:\Anaconda3\lib\site-packages\urllib3\connectionpool.py”, line 343, in _make_request
self._validate_conn(conn)
File “E:\Anaconda3\lib\site-packages\urllib3\connectionpool.py”, line 839, in _validate_conn
conn.connect()
File “E:\Anaconda3\lib\site-packages\urllib3\connection.py”, line 301, in connect
conn = self._new_conn()
File “E:\Anaconda3\lib\site-packages\urllib3\connection.py”, line 168, in _new_conn
self, “Failed to establish a new connection: %s” % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x000001E1C4C12C50>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “E:\Anaconda3\lib\site-packages\requests\adapters.py”, line 449, in send
timeout=timeout
File “E:\Anaconda3\lib\site-packages\urllib3\connectionpool.py”, line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File “E:\Anaconda3\lib\site-packages\urllib3\util\retry.py”, line 399, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host=’openmd.shinnytech.com’, port=443): Max retries exceeded with url: /t/md/symbols/latest.json (Caused by NewConnectionError(‘<urllib3.connection.VerifiedHTTPSConnection object at 0x000001E1C4C12C50>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。’,))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “E:\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py”, line 3296, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File “<ipython-input-2-efa3b9103077>”, line 1, in <module>
runfile(‘E:/TQ_future/htf_signal_test.py’, wdir=’E:/TQ_future’)
File “E:\PyCharm Community Edition 2019.2.2\helpers\pydev\_pydev_bundle\pydev_umd.py”, line 197, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File “E:\PyCharm Community Edition 2019.2.2\helpers\pydev\_pydev_imps\_pydev_execfile.py”, line 18, in execfile
exec(compile(contents+”\n”, file, ‘exec’), glob, loc)
File “E:/TQ_future/htf_signal_test.py”, line 297, in <module>
api = TqApi(TqSim(), backtest=TqBacktest(start_dt=datetime.date(2019, 11, 20), end_dt=datetime.date(2019, 12, 25)))
File “E:\Anaconda3\lib\site-packages\tqsdk\api.py”, line 200, in __init__
self._setup_connection() # 初始化通讯连接
File “E:\Anaconda3\lib\site-packages\tqsdk\api.py”, line 1118, in _setup_connection
“quotes”: self._fetch_symbol_info(self._ins_url)
File “E:\Anaconda3\lib\site-packages\tqsdk\api.py”, line 1164, in _fetch_symbol_info
}, timeout=30)
File “E:\Anaconda3\lib\site-packages\requests\api.py”, line 75, in get
return request(‘get’, url, params=params, **kwargs)
File “E:\Anaconda3\lib\site-packages\requests\api.py”, line 60, in request
return session.request(method=method, url=url, **kwargs)
File “E:\Anaconda3\lib\site-packages\requests\sessions.py”, line 533, in request
resp = self.send(prep, **send_kwargs)
File “E:\Anaconda3\lib\site-packages\requests\sessions.py”, line 646, in send
r = adapter.send(request, **kwargs)
File “E:\Anaconda3\lib\site-packages\requests\adapters.py”, line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host=’openmd.shinnytech.com’, port=443): Max retries exceeded with url: /t/md/symbols/latest.json (Caused by NewConnectionError(‘<urllib3.connection.VerifiedHTTPSConnection object at 0x000001E1C4C12C50>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。’,))

ringo 已回答的问题 2019年12月27日
0

服务早晚7.50左右会定期运维,可能会出现上述情况

如果是非这个时间段的话请检查自己的网络情况,参考这个方案能否解决:https://blog.csdn.net/xiaoxun2802/article/details/78838857#1577364044047

ringo 已回答的问题 2019年12月27日
您正在查看2个答案中的1个,单击此处查看所有答案。