VeighNa量化社区
你的开源社区量化交易平台
Member
avatar
加入于:
帖子: 7
声望: 0

显示安装完成了,运行python run.py会报错如下

Successfully installed tzlocal-2.0.0
(base) lighthouse@VM-16-6-ubuntu:~/vnpy$
(base) lighthouse@VM-16-6-ubuntu:~/vnpy$ python run.py
Traceback (most recent call last):
File "/home/lighthouse/vnpy/run.py", line 3, in <module>
from vnpy.trader.engine import MainEngine
File "/home/lighthouse/vnpy/vnpy/trader/engine.py", line 45, in <module>
from .setting import SETTINGS
File "/home/lighthouse/vnpy/vnpy/trader/setting.py", line 7, in <module>
from tzlocal import get_localzone
ModuleNotFoundError: No module named 'tzlocal'

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

安装vnpy_ctp包
ERROR: Exception:
Traceback (most recent call last):
File "/home/lighthouse/.local/lib/python3.8/site-packages/pip/_vendor/urllib3/response.py", line 438, in _error_catcher
yield
File "/home/lighthouse/.local/lib/python3.8/site-packages/pip/_vendor/urllib3/response.py", line 519, in read
data = self._fp.read(amt) if not fp_closed else b""
File "/home/lighthouse/.local/lib/python3.8/site-packages/pip/_vendor/cachecontrol/filewrapper.py", line 90, in read
data = self.__fp.read(amt)
File "/usr/lib/python3.8/http/client.py", line 455, in read
n = self.readinto(b)
File "/usr/lib/python3.8/http/client.py", line 499, in readinto
n = self.fp.readinto(b)
File "/usr/lib/python3.8/socket.py", line 669, in readinto
return self._sock.recv_into(b)
File "/usr/lib/python3.8/ssl.py", line 1241, in recv_into
return self.read(nbytes, buffer)
File "/usr/lib/python3.8/ssl.py", line 1099, in read
return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/lighthouse/.local/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 167, in exc_logging_wrapper
status = run_func(*args)
File "/home/lighthouse/.local/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 205, in wrapper
return func(self, options, args)
File "/home/lighthouse/.local/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 339, in run
requirement_set = resolver.resolve(
File "/home/lighthouse/.local/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 94, in resolve
result = self._result = resolver.resolve(
File "/home/lighthouse/.local/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 481, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "/home/lighthouse/.local/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 348, in resolve
self._add_to_criteria(self.state.criteria, r, parent=None)
File "/home/lighthouse/.local/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 172, in _add_to_criteria
if not criterion.candidates:
File "/home/lighthouse/.local/lib/python3.8/site-packages/pip/_vendor/resolvelib/structs.py", line 151, in bool
return bool(self._sequence)
File "/home/lighthouse/.local/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 155, in bool
return any(self)
File "/home/lighthouse/.local/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 143, in <genexpr>
return (c for c in iterator if id(c) not in self._incompatible_ids)
File "/home/lighthouse/.local/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 47, in _iter_built
candidate = func()
File "/home/lighthouse/.local/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 215, in _make_candidate_from_link
self._link_candidate_cache[link] = LinkCandidate(
File "/home/lighthouse/.local/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 288, in init
super().init(
File "/home/lighthouse/.local/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 158, in init
self.dist = self._prepare()
File "/home/lighthouse/.local/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 227, in _prepare
dist = self._prepare_distribution()
File "/home/lighthouse/.local/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 299, in _prepare_distribution
return preparer.prepare_linked_requirement(self._ireq, parallel_builds=True)
File "/home/lighthouse/.local/lib/python3.8/site-packages/pip/_internal/operations/prepare.py", line 487, in prepare_linked_requirement
return self._prepare_linked_requirement(req, parallel_builds)
File "/home/lighthouse/.local/lib/python3.8/site-packages/pip/_internal/operations/prepare.py", line 532, in _prepare_linked_requirement
local_file = unpack_url(
File "/home/lighthouse/.local/lib/python3.8/site-packages/pip/_internal/operations/prepare.py", line 214, in unpack_url
file = get_http_url(
File "/home/lighthouse/.local/lib/python3.8/site-packages/pip/_internal/operations/prepare.py", line 94, in get_http_url
from_path, content_type = download(link, temp_dir.path)
File "/home/lighthouse/.local/lib/python3.8/site-packages/pip/_internal/network/download.py", line 146, in call
for chunk in chunks:
File "/home/lighthouse/.local/lib/python3.8/site-packages/pip/_internal/cli/progress_bars.py", line 304, in _rich_progress_bar
for chunk in iterable:
File "/home/lighthouse/.local/lib/python3.8/site-packages/pip/_internal/network/utils.py", line 63, in response_chunks
for chunk in response.raw.stream(
File "/home/lighthouse/.local/lib/python3.8/site-packages/pip/_vendor/urllib3/response.py", line 576, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/home/lighthouse/.local/lib/python3.8/site-packages/pip/_vendor/urllib3/response.py", line 541, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "/usr/lib/python3.8/contextlib.py", line 131, in exit
self.gen.throw(type, value, traceback)
File "/home/lighthouse/.local/lib/python3.8/site-packages/pip/_vendor/urllib3/response.py", line 443, in _error_catcher
raise ReadTimeoutError(self._pool, None, "Read timed out.")
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

Member
avatar
加入于:
帖子: 7
声望: 0
               from vnpy_ctp/api/vnctp/vnctptd/vnctptd.cpp:4:
  vnpy_ctp/api/include/pybind11/detail/common.h:112:10: fatal error: Python.h: No such file or directory
    112 | #include <Python.h>
        |          ^~~~~~~~~~
  compilation terminated.
  error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> vnpy_ctp

Member
avatar
加入于:
帖子: 1468
声望: 105
  1. pip install tzlocal
  2. 你的网络问题连不上pypi的服务器
© 2015-2022 上海韦纳软件科技有限公司
备案服务号:沪ICP备18006526号

沪公网安备 31011502017034号

【用户协议】
【隐私政策】
【免责条款】