8.37K 浏览
0

Traceback (most recent call last):
File “C:\Users\41119\PycharmProjects\untitled\venv\lib\site-packages\urllib3\connectionpool.py”, line 654, in urlopen
conn = self._get_conn(timeout=pool_timeout)
File “C:\Users\41119\PycharmProjects\untitled\venv\lib\site-packages\urllib3\connectionpool.py”, line 274, in _get_conn
return conn or self._new_conn()
File “C:\Users\41119\PycharmProjects\untitled\venv\lib\site-packages\urllib3\connectionpool.py”, line 964, in _new_conn
“Can’t connect to HTTPS URL because the SSL ” “module is not available.”
urllib3.exceptions.SSLError: Can’t connect to HTTPS URL because the SSL module is not available.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:\Users\41119\PycharmProjects\untitled\venv\lib\site-packages\requests\adapters.py”, line 449, in send
timeout=timeout
File “C:\Users\41119\PycharmProjects\untitled\venv\lib\site-packages\urllib3\connectionpool.py”, line 720, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File “C:\Users\41119\PycharmProjects\untitled\venv\lib\site-packages\urllib3\util\retry.py”, line 436, 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 SSLError(“Can’t connect to HTTPS URL because the SSL module is not available.”))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:/Users/41119/PycharmProjects/untitled/woqu.py”, line 7, in <module>
api = TqApi()
File “C:\Users\41119\PycharmProjects\untitled\venv\lib\site-packages\tqsdk\api.py”, line 175, in __init__
self._setup_connection() # 初始化通讯连接
File “C:\Users\41119\PycharmProjects\untitled\venv\lib\site-packages\tqsdk\api.py”, line 963, in _setup_connection
“quotes”: self._fetch_symbol_info(self._ins_url)
File “C:\Users\41119\PycharmProjects\untitled\venv\lib\site-packages\tqsdk\api.py”, line 997, in _fetch_symbol_info
}, timeout=30)
File “C:\Users\41119\PycharmProjects\untitled\venv\lib\site-packages\requests\api.py”, line 75, in get
return request(‘get’, url, params=params, **kwargs)
File “C:\Users\41119\PycharmProjects\untitled\venv\lib\site-packages\requests\api.py”, line 60, in request
return session.request(method=method, url=url, **kwargs)
File “C:\Users\41119\PycharmProjects\untitled\venv\lib\site-packages\requests\sessions.py”, line 533, in request
resp = self.send(prep, **send_kwargs)
File “C:\Users\41119\PycharmProjects\untitled\venv\lib\site-packages\requests\sessions.py”, line 646, in send
r = adapter.send(request, **kwargs)
File “C:\Users\41119\PycharmProjects\untitled\venv\lib\site-packages\requests\adapters.py”, line 514, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host=’openmd.shinnytech.com’, port=443): Max retries exceeded with url: /t/md/symbols/latest.json (Caused by SSLError(“Can’t connect to HTTPS URL because the SSL module is not available.”))
Task was destroyed but it is pending!
task: <Task pending coro=<TqApi._windows_patch() running at C:\Users\41119\PycharmProjects\untitled\venv\lib\site-packages\tqsdk\api.py:1178> cb=[TqApi._on_task_done()]>
Task was destroyed but it is pending!
task: <Task pending coro=<TqApi._notify_watcher() running at C:\Users\41119\PycharmProjects\untitled\venv\lib\site-packages\tqsdk\api.py:1183> cb=[TqApi._on_task_done()]>
sys:1: RuntimeWarning: coroutine ‘TqApi._windows_patch’ was never awaited
sys:1: RuntimeWarning: coroutine ‘TqApi._notify_watcher’ was never awaited

期市猎人 已回答的问题 2019年12月12日
0

参考以下链接解决:https://blog.csdn.net/qq_36823518/article/details/88406237

SSL模块不可用,网上的解决办法多为linux系统的办法。为数不多的关于windows的办法也无效。
最后找到解决办法:
指定安装1.0.2版本的openssl,也就是:
conda install openssl=1.0.2
安装好之后问题解决。

期市猎人 已回答的问题 2019年12月12日
0

有人解决了吗?我也是这个提示。

环境是:win10+anaconda 3 (python3.7-64位),vs Code里运行后提示如下。

PS D:\Pythoncode\qihuo> & ‘d:\Program\Anaconda3\python.exe’ ‘c:\Users\Administrator\.vscode\extensions\ms-python.python-2019.11.50794\pythonFiles\ptvsd_launcher.py’
‘–default’ ‘–client’ ‘–host’ ‘localhost’ ‘–port’ ‘51095’ ‘d:\Pythoncode\qihuo\tq_test.py’
Traceback (most recent call last):
File “D:\Program\Anaconda3\lib\site-packages\urllib3\connectionpool.py”, line 588, in urlopen
conn = self._get_conn(timeout=pool_timeout)
File “D:\Program\Anaconda3\lib\site-packages\urllib3\connectionpool.py”, line 248, in _get_conn
return conn or self._new_conn()
File “D:\Program\Anaconda3\lib\site-packages\urllib3\connectionpool.py”, line 816, in _new_conn
raise SSLError(“Can’t connect to HTTPS URL because the SSL ”
urllib3.exceptions.SSLError: Can’t connect to HTTPS URL because the SSL module is not available.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “D:\Program\Anaconda3\lib\site-packages\requests\adapters.py”, line 449, in send
timeout=timeout
File “D:\Program\Anaconda3\lib\site-packages\urllib3\connectionpool.py”, line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File “D:\Program\Anaconda3\lib\site-packages\urllib3\util\retry.py”, line 398, 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 SSLError(“Can’t connect to HTTPS URL because the SSL module is not available.”))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “c:\Users\Administrator\.vscode\extensions\ms-python.python-2019.11.50794\pythonFiles\ptvsd_launcher.py”, line 43, in <module>
main(ptvsdArgs)
File “c:\Users\Administrator\.vscode\extensions\ms-python.python-2019.11.50794\pythonFiles\lib\python\old_ptvsd\ptvsd\__main__.py”, line 432, in main
run()
File “c:\Users\Administrator\.vscode\extensions\ms-python.python-2019.11.50794\pythonFiles\lib\python\old_ptvsd\ptvsd\__main__.py”, line 316, in run_file
runpy.run_path(target, run_name=’__main__’)
File “D:\Program\Anaconda3\lib\runpy.py”, line 263, in run_path
pkg_name=pkg_name, script_name=fname)
File “D:\Program\Anaconda3\lib\runpy.py”, line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File “D:\Program\Anaconda3\lib\runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “d:\Pythoncode\qihuo\tq_test.py”, line 13, in <module>
api = TqApi()
File “D:\Program\Anaconda3\lib\site-packages\tqsdk\api.py”, line 181, in __init__
self._setup_connection() # 初始化通讯连接
File “D:\Program\Anaconda3\lib\site-packages\tqsdk\api.py”, line 1092, in _setup_connection
“quotes”: self._fetch_symbol_info(self._ins_url)
File “D:\Program\Anaconda3\lib\site-packages\tqsdk\api.py”, line 1132, in _fetch_symbol_info
}, timeout=30)
File “D:\Program\Anaconda3\lib\site-packages\requests\api.py”, line 75, in get
return request(‘get’, url, params=params, **kwargs)
File “D:\Program\Anaconda3\lib\site-packages\requests\api.py”, line 60, in request
return session.request(method=method, url=url, **kwargs)
File “D:\Program\Anaconda3\lib\site-packages\requests\sessions.py”, line 533, in request
resp = self.send(prep, **send_kwargs)
File “D:\Program\Anaconda3\lib\site-packages\requests\sessions.py”, line 646, in send
r = adapter.send(request, **kwargs)
File “D:\Program\Anaconda3\lib\site-packages\requests\adapters.py”, line 514, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host=’openmd.shinnytech.com’, port=443): Max retries exceeded with url: /t/md/symbols/latest.json (Caused by SSLError(“Can’t connect to HTTPS URL because the SSL module is not available.”))
Task was destroyed but it is pending!
task: <Task pending coro=<TqApi._windows_patch() running at D:\Program\Anaconda3\lib\site-packages\tqsdk\api.py:1442> cb=[TqApi._on_task_done()]>
Task was destroyed but it is pending!
task: <Task pending coro=<TqApi._notify_watcher() running at D:\Program\Anaconda3\lib\site-packages\tqsdk\api.py:1447> cb=[TqApi._on_task_done()]>
sys:1: RuntimeWarning: coroutine ‘TqApi._windows_patch’ was never awaited
sys:1: RuntimeWarning: coroutine ‘TqApi._notify_watcher’ was never awaited

期市猎人 已回答的问题 2019年12月12日
0

重装下python吧,看好python版本

pp465 已回答的问题 2019年10月13日
0

看你的报错信息是urllib3.exceptions.SSLError: Can’t connect to HTTPS URL because the SSL module is not available.

可能是某些模块如openssl等没有安装,或者环境没有配置好,可以先检查一下

west 发表新评论 2019年10月11日

或者可以换http试下,先不用https