No module named 'qlib.tests
❓ Questions and Help
(TF2..1) D:\winAI\qlib-main>python scripts/get_data.py qlib_data --target_dir ~/.qlib/qlib_data/cn_data --region cn
Traceback (most recent call last):
File "scripts/get_data.py", line 4, in
Yes I get the same error.
I use conda on linux and had the same error. I created new environment, installed qlib via provided script (python setup.py install), did initialization (from the documentation page) and after was able to run the test script successfully. At some point there was an error on module 'fire' missing, installing this module with conda resolved this error
pip will install latest stable qlib. However the main branch of qlib is in active development. If you want to test the latest scripts or functions in main branch. Please install qlib with python setup.py install or python setup.py develop
Thanks
You can try it like this:
- uninstall pyqlib:
python -m pip uninstall pyqlib - delete "pyqlib*" and "qlib*" under
site-packages - reinstall qlib:
pip install pyqliborpython setup.py install
cd source_dir_root touch ./scripts/init.py python -m scripts.get_data qlib_data --target_dir ~/.qlib/qlib_data/cn_data --region cn
it works for me. hope it helps.
attention: qlib.tests package is not included in site-packages after qlib installed.
Hi, We've release a new version(0.6.1) of qlib just now. Some recent features in dev version are included.
So you can solve this problem by pip install --upgrade pyqlib or follow the instructions in homepage to install dev version of qlib.
I was able to resolve this by creating new "Conda" virtual environment and installing by pip install pyqlib. One additional library I had to install was pip install nbformat. Thanks.
This worked for me. git clone https://github.com/microsoft/qlib.git && cd qlib pip install .