vn.py量化社区
By Traders, For Traders.
Member
avatar
加入于:
帖子: 8
声望: 0

ImportError Traceback (most recent call last)

<ipython-input-18-0425f567fc2e> in <module>
2 import sys
3 print( sys.path)
----> 4 from vnpy.app.cta_strategy.backtesting import BacktestingEngine, OptimizationSetting
5 # from vnpy.app.cta_strategy.strategies.atr_rsi_strategy import (
6 # AtrRsiStrategy,

g:\Java\Anaconda3\envs\vnpy\lib\site-packages\vnpy\app\cta_strategy__init__.py in <module>
8 from .base import APP_NAME, StopOrder
9 from .engine import CtaEngine
---> 10 from .backtesting import BacktestingEngine, OptimizationSetting
11 from .template import CtaTemplate, CtaSignal, TargetPosTemplate
12

g:\Java\Anaconda3\envs\vnpy\lib\site-packages\vnpy\app\cta_strategy\backtesting.py in <module>
10 import numpy as np
11 import matplotlib.pyplot as plt
---> 12 import seaborn as sns
13 from pandas import DataFrame
14 from deap import creator, base, tools, algorithms

g:\Java\Anaconda3\envs\vnpy\lib\site-packages\seaborn__init__.py in <module>
4
5 # Import seaborn objects
----> 6 from .rcmod import
7 from .utils import

8 from .palettes import *

g:\Java\Anaconda3\envs\vnpy\lib\site-packages\seaborn\rcmod.py in <module>
3 import functools
4 import matplotlib as mpl
----> 5 from . import palettes, _orig_rc_params
6
7

g:\Java\Anaconda3\envs\vnpy\lib\site-packages\seaborn\palettes.py in <module>
10 from .external.six.moves import range
11
---> 12 from .utils import desaturate, set_hls_values, get_color_cycle
13 from .colors import xkcd_rgb, crayons
14

g:\Java\Anaconda3\envs\vnpy\lib\site-packages\seaborn\utils.py in <module>
5
6 import numpy as np
----> 7 from scipy import stats
8 import pandas as pd
9 import matplotlib as mpl

g:\Java\Anaconda3\envs\vnpy\lib\site-packages\scipy\stats__init.py in <module>
377 from
future__ import division, print_function, absolute_import
378
--> 379 from .stats import
380 from .distributions import

381 from .morestats import *

g:\Java\Anaconda3\envs\vnpy\lib\site-packages\scipy\stats\stats.py in <module>
180 import scipy.special as special
181 from scipy import linalg
--> 182 from . import distributions
183 from . import mstats_basic
184 from ._stats_mstats_common import (_find_repeats, linregress, theilslopes,

g:\Java\Anaconda3\envs\vnpy\lib\site-packages\scipy\stats\distributions.py in <module>
8 from future import division, print_function, absolute_import
9
---> 10 from ._distn_infrastructure import (entropy, rv_discrete, rv_continuous,
11 rv_frozen)
12

g:\Java\Anaconda3\envs\vnpy\lib\site-packages\scipy\stats_distn_infrastructure.py in <module>
22
23 # for root finding for discrete distribution ppf, and max likelihood estimation
---> 24 from scipy import optimize
25
26 # for functions of continuous distributions (e.g. moments, entropy, cdf)

g:\Java\Anaconda3\envs\vnpy\lib\site-packages\scipy\optimize__init__.py in <module>
389
390 from .optimize import
--> 391 from ._minimize import

392 from ._root import
393 from ._root_scalar import

g:\Java\Anaconda3\envs\vnpy\lib\site-packages\scipy\optimize_minimize.py in <module>
28 from ._trustregion_krylov import _minimize_trust_krylov
29 from ._trustregion_exact import _minimize_trustregion_exact
---> 30 from ._trustregion_constr import _minimize_trustregion_constr
31
32 # constrained minimization

g:\Java\Anaconda3\envs\vnpy\lib\site-packages\scipy\optimize_trustregion_constr__init.py in <module>
2
3
----> 4 from .minimize_trustregion_constr import _minimize_trustregion_constr
5
6
all__ = ['_minimize_trustregion_constr']

g:\Java\Anaconda3\envs\vnpy\lib\site-packages\scipy\optimize_trustregion_constr\minimize_trustregion_constr.py in <module>
2 import time
3 import numpy as np
----> 4 from scipy.sparse.linalg import LinearOperator
5 from .._differentiable_functions import VectorFunction
6 from .._constraints import (

g:\Java\Anaconda3\envs\vnpy\lib\site-packages\scipy\sparse\linalg__init__.py in <module>
114 from .dsolve import
115 from .interface import

--> 116 from .eigen import
117 from .matfuncs import

118 from ._onenormest import *

g:\Java\Anaconda3\envs\vnpy\lib\site-packages\scipy\sparse\linalg\eigen__init.py in <module>
9 from
future__ import division, print_function, absolute_import
10
---> 11 from .arpack import
12 from .lobpcg import

13

g:\Java\Anaconda3\envs\vnpy\lib\site-packages\scipy\sparse\linalg\eigen\arpack__init.py in <module>
20 from
future__ import division, print_function, absolute_import
21
---> 22 from .arpack import *

g:\Java\Anaconda3\envs\vnpy\lib\site-packages\scipy\sparse\linalg\eigen\arpack\arpack.py in <module>
43 all = ['eigs', 'eigsh', 'svds', 'ArpackError', 'ArpackNoConvergence']
44
---> 45 from . import _arpack
46 import numpy as np
47 import warnings

ImportError: DLL load failed: 找不到指定的程序。

异常堆栈如上,确定python执行的sys.path和sys.executable正确,搞了一晚上了,愁死了

Administrator
avatar
加入于:
帖子: 4028
声望: 221

所有Anaconda上的环境问题,我们一律建议请使用VNStudio,不要浪费时间折腾了

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

VNStudio我安装了,然后我下载了github上的源代码,可以运行在我的Anaconda上的python3.7环境上
然后我按照课程中说的,用cmd命令打开jupyter notebook,切换kernel到python3.7环境,运行就报那样的错
您说的使用VNStudio该如何操作呢,我打开VNStudio界面点开的jupyter notebook也是报那样的错

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

意思是不要用jupyter notebook了吗 蛋疼啊

Administrator
avatar
加入于:
帖子: 4028
声望: 221

跟jupyter notebook没关系,卸载掉Anaconda去除Python环境污染就行了

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