开源地址:GitHub - microsoft/qlib: Qlib is an AI-oriented quantitative investment platform that aims to realize the potential, empower research, and create value using AI technologies in quantitative investment, from exploring ideas to implementing productions. Qlib supports diverse machine learning modeling paradigms. including supervised learning, market dynamics modeling, and RL.Qlib is an AI-oriented quantitative investment platform that aims to realize the potential, empower research, and create value using AI technologies in quantitative investment, from exploring ideas to implementing productions. Qlib supports diverse machine learning modeling paradigms. including supervised learning, market dynamics modeling, and RL. - microsoft/qlibhttps://github.com/microsoft/qlib
使用conda创建一个新的环境,python3.7
采用源码安装的时候进行安装,在从源代码安装 Qlib 之前,用户需要安装一些依赖项:
pip install numpy
pip install --upgrade cython
git clone https://github.com/microsoft/qlib.git && cd qlib
pip install . # 推荐使用 `pip install -e .[dev]` 用于开发。详情参阅文档的 developer/code_standard_and_dev_guide.rst
注意:您也可以使用 python setup.py install
来安装 Qlib。但这不是推荐的方法,它将跳过 pip
,可能导致模糊的问题。例如,只有命令 pip install .
才能覆盖由 pip install pyqlib
安装的稳定版本,而命令 python setup.py install
则无法做到。
在win11下安装报错:error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
需要Microsoft Visual C++14.0或更高版本,获取Microsoft C++ Build Tools。报错原因是pip所安装的包需要使用C++编译后才能够正常安装,但是当前安装环境中缺少完整的C++编译环境,因此安装失败。
按照输出的信息,我们可以下载安装"Microsoft C++ Build Tools"这个工具,为了安装这个环境,直接安装一个visual Studio十几个G也是可以,他会自动帮你把所有需要的包安装好,就是太大了,很多不是必要的包也安装了。
安装完成后,重新编译,编译通过。
在导入包时, from qlib.data import D,报错
import _ssl # if we can't import it, let the error propagate
在Anaconda3目录下搜索找到以下两个文件:
libcrypto-1_1-x64.dll
libssl-1_1-x64.dl
复制到运行环境的DLLs的目录下
ModuleNotFoundError: No module named ‘qlib.data._libs.rolling’
If the error occurs when importing qlib
package with PyCharm
IDE, users can execute the following command in the project root folder to compile Cython files and generate executable files:
python setup.py build_ext --inplace