vn.py官网
开源量化社区
Member
avatar
加入于:
帖子: 58
声望: 0

代码在老版本2.1.9可以正常运行,迁移到新版本时开着代理就会报错,报错如下:

File "D:\Pycharm Project\vnpy2.5.0_pro\vnpy\database\influxdb\influxdb_database.py", line 667, in <module>
database_manager = InfluxdbDatabase()
File "D:\Pycharm Project\vnpy2.5.0_pro\vnpy\database\influxdb\influxdb_database.py", line 109, in init
self.client.create_database(database)
File "C:\Users\VDV\anaconda3\envs\vnpy2.5.0_pro\lib\site-packages\influxdb\client.py", line 747, in create_database
method="POST")
File "C:\Users\VDV\anaconda3\envs\vnpy2.5.0_pro\lib\site-packages\influxdb\client.py", line 527, in query
expected_response_code=expected_response_code
File "C:\Users\VDV\anaconda3\envs\vnpy2.5.0_pro\lib\site-packages\influxdb\client.py", line 342, in request
timeout=self._timeout
File "C:\Users\VDV\anaconda3\envs\vnpy2.5.0_pro\lib\site-packages\requests\sessions.py", line 542, in request
resp = self.send(prep, send_kwargs)
File "C:\Users\VDV\anaconda3\envs\vnpy2.5.0_pro\lib\site-packages\requests\sessions.py", line 655, in send
r = adapter.send(request,
kwargs)
File "C:\Users\VDV\anaconda3\envs\vnpy2.5.0_pro\lib\site-packages\requests\adapters.py", line 449, in send
timeout=timeout
File "C:\Users\VDV\anaconda3\envs\vnpy2.5.0_pro\lib\site-packages\urllib3\connectionpool.py", line 696, in urlopen
self._prepare_proxy(conn)
File "C:\Users\VDV\anaconda3\envs\vnpy2.5.0_pro\lib\site-packages\urllib3\connectionpool.py", line 964, in _prepare_proxy
conn.connect()
File "C:\Users\VDV\anaconda3\envs\vnpy2.5.0_pro\lib\site-packages\urllib3\connection.py", line 359, in connect
conn = self._connect_tls_proxy(hostname, conn)
File "C:\Users\VDV\anaconda3\envs\vnpy2.5.0_pro\lib\site-packages\urllib3\connection.py", line 506, in _connect_tls_proxy
ssl_context=ssl_context,
File "C:\Users\VDV\anaconda3\envs\vnpy2.5.0pro\lib\site-packages\urllib3\util\ssl.py", line 453, in ssl_wrap_socket
ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls)
File "C:\Users\VDV\anaconda3\envs\vnpy2.5.0pro\lib\site-packages\urllib3\util\ssl.py", line 495, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock)
File "C:\Users\VDV\anaconda3\envs\vnpy2.5.0_pro\lib\ssl.py", line 423, in wrap_socket
session=session
File "C:\Users\VDV\anaconda3\envs\vnpy2.5.0_pro\lib\ssl.py", line 827, in _create
raise ValueError("check_hostname requires server_hostname")
ValueError: check_hostname requires server_hostname

vnpy2.5.0 开着代理跑回测时就不能读取云端influxDB数据库的数据,疑似新版的 requests 或者 urllib3库需要配置代理的IP和端口,请问这个应该在哪里设置呢

关了代理之后,代码都可以正常跑通,但是因为工作需求还是一直需要连接着代理的,所以这个就很头疼,又不能总是手动开关代理来解决这个问题。

Member
avatar
加入于:
帖子: 58
声望: 0

description

Member
avatar
加入于:
帖子: 58
声望: 0

description

Member
avatar
加入于:
帖子: 58
声望: 0

无语了,手动关闭代理那个是可以正常运行了,但是代理基本上也就是等于关了。
请问大家有解决了这个问题的吗?

Administrator
avatar
加入于:
帖子: 5078
声望: 293

不会折腾的话,请使用海外云服务器

© 2015-2019 上海韦纳软件科技有限公司
备案服务号:沪ICP备18006526号-3

沪公网安备 31011502017034号