vn.py官网
你的开源社区量化交易平台
Member
avatar
加入于:
帖子: 6
声望: 0

在本地WINDOW系统没有问题, 打算上云测試, 买了阿里云香港UBUNTU20服务器, 折腾三天, 基本把论坛UBUNTU的贴子都爬了遍, 实在没招了來求助.

VNPY安装是显示成功的, 如果run.py中的模块用#注释掉, 可以打开VNPY, 但点击上方"功能"无反应, 如果不注释掉, 都会出現:
ModuleNotFoundError: No module named 'vnpy_ctastrategy'

vnpy_ctp, 回测模块, futu接口等等只要不注释掉一样会出現no module named.
在linux系统下搜索文件夹, 确实也搜不出任何VNPY_模块(我本地用WINDOW在sitepacket能看到模块文件夹)

于是判断是VNPY的安装出问题, miniconda应該是成功了的, 终端输入PYTHON能看到是3.7版本
在试图用bash install.sh安装时, 没有任何异常, 但在用python setup.py install安装, 会有如下红字(有几行是黃的):

ERROR: Command errored out with exit status 1:
command: /root/miniconda3/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6g72zrnt/arctic_f5e520ad792d41dfbe2cfeb5f322fd4c/setup.py'"'"'; file='"'"'/tmp/pip-install-6g72zrnt/arctic_f5e520ad792d41dfbe2cfeb5f322fd4c/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egginfo --egg-base /tmp/pip-pip-egg-info-tnikl5k
cwd: /tmp/pip-install-6g72zrnt/arctic_f5e520ad792d41dfbe2cfeb5f322fd4c/
Complete output (37 lines):
WARNING: The repository located at mirrors.cloud.aliyuncs.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it anyway with '--trusted-host mirrors.cloud.aliyuncs.com'.
ERROR: Could not find a version that satisfies the requirement setuptools-git (from versions: none)
ERROR: No matching distribution found for setuptools-git
/root/miniconda3/lib/python3.7/site-packages/setuptools/dist.py:720: UserWarning: Usage of dash-separated 'index-url' will not be supported in future versions. Please use the underscore name 'index_url' instead
% (opt, underscore_opt)
/root/miniconda3/lib/python3.7/site-packages/setuptools/installer.py:30: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
SetuptoolsDeprecationWarning,
Traceback (most recent call last):
File "/root/miniconda3/lib/python3.7/site-packages/setuptools/installer.py", line 82, in fetch_build_egg
subprocess.check_call(cmd)
File "/root/miniconda3/lib/python3.7/subprocess.py", line 363, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/root/miniconda3/bin/python', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpupyu2aht', '--quiet', '--index-url', 'http://mirrors.cloud.aliyuncs.com/pypi/simple/', 'setuptools-git']' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-6g72zrnt/arctic_f5e520ad792d41dfbe2cfeb5f322fd4c/setup.py", line 122, in <module>
"Topic :: Software Development :: Libraries",
File "/root/miniconda3/lib/python3.7/site-packages/setuptools/init.py", line 152, in setup
_install_setup_requires(attrs)
File "/root/miniconda3/lib/python3.7/site-packages/setuptools/init.py", line 147, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "/root/miniconda3/lib/python3.7/site-packages/setuptools/dist.py", line 809, in fetch_build_eggs
replace_conflicting=True,
File "/root/miniconda3/lib/python3.7/site-packages/pkg_resources/init.py", line 773, in resolve
replace_conflicting=replace_conflicting
File "/root/miniconda3/lib/python3.7/site-packages/pkg_resources/init.py", line 1056, in best_match
return self.obtain(req, installer)
File "/root/miniconda3/lib/python3.7/site-packages/pkg_resources/init.py", line 1068, in obtain
return installer(requirement)
File "/root/miniconda3/lib/python3.7/site-packages/setuptools/dist.py", line 877, in fetch_build_egg
return fetch_build_egg(self, req)
File "/root/miniconda3/lib/python3.7/site-packages/setuptools/installer.py", line 84, in fetch_build_egg
raise DistutilsError(str(e)) from e
distutils.errors.DistutilsError: Command '['/root/miniconda3/bin/python', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpupyu2aht', '--quiet', '--index-url', 'http://mirrors.cloud.aliyuncs.com/pypi/simple/', 'setuptools-git']' returned non-zero exit status 1.

WARNING: Discarding http://mirrors.cloud.aliyuncs.com/pypi/packages/dc/8a/315a013a86d9ee13c81d38e27a55f9d89eb9ff8f09827a963e7d32a70132/arctic-1.80.0.tar.gz#sha256=e81eabe3f23c713711eb944666531becbb6b16caba8c0b8bca4422bf19188430 (from http://mirrors.cloud.aliyuncs.com/pypi/simple/arctic/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

EROR: Could not find a version that satisfies the requirement plyvel-win32 (from vnpy-leveldb) (from versions: none)
ERROR: No matching distribution found for plyvel-win32

WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

Administrator
avatar
加入于:
帖子: 142
声望: 17

linux在安装miniconda后,系统会有两个python环境
使用miniconda默认的python环境时,终端显示如下
description
麻烦检查一下安装和使用的python环境是否是同一个。

plyvel-win32 errors是因为plyvel-win32不支持linux,可以在源码requirement里把vnpy_leveldb注释掉

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

VNPY的模块成功用pip install另外装好了, 运行run.py出現了新的问题, 也是没找到合适的方法:

Got keys from plugin meta data ("xcb_glx")
QFactoryLoader::QFactoryLoader() checking directory path "/root/miniconda3/bin/xcbglintegrations" ...
loaded library "/root/miniconda3/lib/python3.7/site-packages/PyQt5/Qt5/plugins/xcbglintegrations/libqxcb-glx-integration.so"
qt.glx: qglx_findConfig: Failed to finding matching FBConfig for QSurfaceFormat(version 2.0, options QFlags`t::FormatOption(), depthBufferSize -1, redBufferSize 1, greenBufferSize 1, blueBufferSize 1, alphaBufferSize -1, stencilBufferSize -1, samples -1, swapBehavior QSurfaceFormat::SingleBuffer, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile QSurfaceFormat::NoProfile)
Unsupported screen format: depth: 16, bits_per_pixel: 16, red_mask: 3f, blue_mask: f800
Using RGB16 fallback, if this works your X11 server is reporting a bad screen format.
QFactoryLoader::QFactoryLoader() checking directory path "/root/miniconda3/lib/python3.7/site-packages/PyQt5/Qt5/plugins/accessible" ...
QFactoryLoader::QFactoryLoader() checking directory path "/root/miniconda3/bin/accessible" ...

Administrator
avatar
加入于:
帖子: 142
声望: 17

应该是QT问题,不要使用putty,使用vnc试试

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

郭易燔 wrote:

应该是QT问题,不要使用putty,使用vnc试试
很感謝大佬回复! 我又把run.py下的报错整段重复看了, 原來在报上述错誤之前还有別的缺包, 把里面提示的包全部用pip install之后就正常运行了, 包括vnpy_ctastragey, vnpy_ctp等等的包, 全部使用pip install解決了, 不过富途的包还不知道要怎么搞, futu路徑是vnpy.gateway.futu, 不是vnpy_futu, 所以还不知道怎么弄

Administrator
avatar
加入于:
帖子: 57
声望: 5

KoMxDESTINY wrote:

郭易燔 wrote:

应该是QT问题,不要使用putty,使用vnc试试
很感謝大佬回复! 我又把run.py下的报错整段重复看了, 原來在报上述错誤之前还有別的缺包, 把里面提示的包全部用pip install之后就正常运行了, 包括vnpy_ctastragey, vnpy_ctp等等的包, 全部使用pip install解決了, 不过富途的包还不知道要怎么搞, futu路徑是vnpy.gateway.futu, 不是vnpy_futu, 所以还不知道怎么弄
现在futu接口还没有剥离,直接从vnpy.gateway.futu导入就可以使用。

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

沪公网安备 31011502017034号