New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wiki :如何设置PyCharm进行单步调试 #7

Closed
wudenggang0 opened this Issue Aug 10, 2016 · 14 comments

Comments

Projects
None yet
10 participants
@wudenggang0
Copy link

wudenggang0 commented Aug 10, 2016

wiki :使用PyCharm进行单步调试。
在window中如何进行第二步debug设置(下载zip格式)
pycharm debug

@cedricporter

This comment has been minimized.

Copy link
Member

cedricporter commented Aug 10, 2016

python -m rqalpha run -f ... 等价于 rqalpha run -f ...

即你可以在 Script 填上 python.exe 的路径,然后 Script Params: 改成 -m rqalpha run -f ... 这样试一下

您也可以查看关于如何使用 Pycharm 调试的文档: http://rqalpha.readthedocs.io/zh_CN/develop/intro/under_ide.html

@wudenggang0

This comment has been minimized.

Copy link

wudenggang0 commented Aug 11, 2016

按照你的设定方法,同样报错。script的地方应该是设定rqalpha的位置(script入口)。
pycharm debug
pycharm debug

@cedricporter

This comment has been minimized.

Copy link
Member

cedricporter commented Aug 11, 2016

这样的话你找一下源码里面有个 __main__.py ,你在Script填上这个文件就好。我这里没有Windows环境,不好验证。

或者你可以自己写个 start.py ,里面调用下 __main__.py 中的 entry_point(),然后以 start.py 作为入口文件

from rqalpha.__main__ import entry_point
entry_point()
@wudenggang0

This comment has been minimized.

Copy link

wudenggang0 commented Aug 19, 2016

使用start.py方法可以Run成功(加上--plot参数就可以看到图形)。当然后面发现自己的文件目录也有问题。
pycharm debug
pycharm debug 1

@cedricporter

This comment has been minimized.

Copy link
Member

cedricporter commented Sep 5, 2016

如果需要hack源码并且调试自己的源码。

需要在 源码目录 pip install -e . 这样来安装 rqalpha 。

@wh1100717 wh1100717 changed the title wiki :使用PyCharm进行单步调试。在window中如何进行debug设置 wiki :如何设置PyCharm进行单步调试 May 2, 2017

@wh1100717

This comment has been minimized.

Copy link
Member

wh1100717 commented May 9, 2017

在 Python 3.5 3.6 下 对应的 Scripts 目录里面应该是包含 rqalpha-script.py 文件的。 应该是可以作为入口文件的。 可以尝试一下

image

@cfz87862529

This comment has been minimized.

Copy link

cfz87862529 commented May 15, 2017

你好,我的是windows环境,在最新的rqalpha版本2.2.4下未发现rqalpha-script.py文件。

@wh1100717

This comment has been minimized.

Copy link
Member

wh1100717 commented May 15, 2017

@cfz87862529 那就找一下对应的入口文件 http://rqalpha.io/zh_CN/latest/intro/under_ide.html#rqalphaconda

或者尝试上面的方式来写一个入口文件脚本

@binosun

This comment has been minimized.

Copy link

binosun commented Jun 23, 2017

@cfz87862529 这样配置试试
image

@wangmeng2017

This comment has been minimized.

Copy link

wangmeng2017 commented Sep 19, 2017

image 004
rqalpha.exe存在,但是在如图的界面下看不到,手工输入的话“OK”按钮是灰色的无法保存。难道是我哪里设置错了吗?

@yuandi0823

This comment has been minimized.

Copy link

yuandi0823 commented Nov 9, 2017

@cedricporter rq3.0.6 py2.7 pycharm debug
1510212128 1
error
D:\Work\VM\Anaconda2\envs\A2ENV\python.exe "D:\Work\IDE\JetBrains\PyCharm Community Edition 2017.2.4\helpers\pydev\pydevd.py" --multiproc --qt-support=auto --client 127.0.0.1 --port 58546 --file D:/Work/XProject/PyProject/pyqt/t1/start.py run -f ./t1/h4.py -d D:/Work/DB/rqalpha/bundle/ -s 2016-06-01 -e 2016-12-01 --account stock 100000 --benchmark 000300.XSHG --plot
pydev debugger: process 12488 is connecting

Connected to pydev debugger (build 172.4343.24)
Error: no such option: --multiproc

Process finished with exit code 2

@lixuefeng613

This comment has been minimized.

Copy link

lixuefeng613 commented Jan 22, 2018

image
新版本pycharm改了,我选择了模块名字,
下面的参数再填写,就可以dedebug了
image

run -f buy_and_hold.py -d ./bundle/ -s 2018-01-18 -e 2018-01-21 --account stock 100000 --benchmark 000300.XSHG

@hzliu

This comment has been minimized.

Copy link
Contributor

hzliu commented Jan 25, 2018

:)
thanks

@a5601564

This comment has been minimized.

Copy link

a5601564 commented Mar 27, 2018

config = {
"base": {
"data_bundle_path": "C:\Users\Administrator\.rqalpha\bundle",
"start_date": "2016-06-01",
"end_date": "2016-12-01",
"benchmark": "000300.XSHG",
"accounts": {
"stock": 100000
}
},
"extra": {
"log_level": "verbose",
},
"mod": {
"sys_analyser": {
"enabled": True,
"plot": True
}
}
}

run_func(init=init, handle_bar=handle_bar, config=config)

原来还可以这么玩的,就不用配置这些垃圾玩意了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment