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
安装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.
显示安装完成了,运行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'
home/lighthouse/miniconda3/lib/python3.9/site-packages/setuptools/installer.py:27: SetuptoolsDeprec
ationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 inst
aller.
warnings.warn(
大佬们,引用https://www.vnpy.com/docs/cn/ubuntu_install.html#miniconda 帖子中安装vnpy的叙述,在执行python setup.py install
的时候卡住了,显示上面的文案,有遇到过吗
请问你安装的是最新版本吗,2.9
根据最新2.9版本代码中的readMe指示安装,最后效果如下。
Stored in directory: /Users/wanxiangyu/Library/Caches/pip/wheels/db/c8/e0/0c9dbd8dcffcb3f418a410c26c3cb007ca7b57ca8f3d138b90
Successfully built vnpy peewee
Installing collected packages: PyQt5-Qt5, peewee, msgpack, brotli, SQLAlchemy, scipy, pyzmq, python-rapidjson, PyQt5-sip, pymysql, orjson, deap, PyQt5, seaborn, rqdatac, QScintilla, vnpy
Successfully installed PyQt5-5.15.6 PyQt5-Qt5-5.15.2 PyQt5-sip-12.9.1 QScintilla-2.13.1 SQLAlchemy-1.3.24 brotli-1.0.9 deap-1.3.1 msgpack-1.0.3 orjson-3.6.7 peewee-3.14.9 pymysql-1.0.2 python-rapidjson-1.6 pyzmq-22.3.0 rqdatac-2.9.45.1 scipy-1.8.0 seaborn-0.11.2 vnpy-2.9.0
然后运行python run.py显示
Traceback (most recent call last):
File "run.py", line 5, in <module>
from vnpy.trader.ui import MainWindow, create_qapp
File "/Users/**/Downloads/vnpy-master/venv/lib/python3.8/site-packages/vnpy/trader/ui/init.py", line 11, in <module>
from .mainwindow import MainWindow
File "/Users//Downloads/vnpy-master/venv/lib/python3.8/site-packages/vnpy/trader/ui/mainwindow.py", line 14, in <module>
from .widget import (
File "/Users/*/Downloads/vnpy-master/venv/lib/python3.8/site-packages/vnpy/trader/ui/widget.py", line 13, in <module>
import importlib_metadata
ModuleNotFoundError: No module named 'importlib_metadata'
如何使用自己的csv数据,有什么格式要求么,请大佬分享下细节