qlib icon indicating copy to clipboard operation
qlib copied to clipboard

downloading data problem -- undefined symbol: _ZSt28__throw_bad_array_new_lengthv

Open John-8911797110 opened this issue 2 years ago • 10 comments

my envs are python3.9.7 cython 0.29.28 gcc 11.2 linux ubuntu_64

when I download cn data in qlib dir by command " python scripts/get_data.py qlib_data --target_dir ~/.qlib/qlib_data/cn_data --region cn" I got a problem:

Do not import qlib package in the repository directory in case of importing qlib from . without compiling

Traceback (most recent call last): File "/home/yqm/Programs/qlib/scripts/get_data.py", line 5, in from qlib.tests.data import GetData File "/home/yqm/miniconda3/lib/python3.9/site-packages/pyqlib-0.8.4.99-py3.9-linux-x86_64.egg/qlib/tests/init.py", line 5, in from qlib.data.filter import NameDFilter File "/home/yqm/miniconda3/lib/python3.9/site-packages/pyqlib-0.8.4.99-py3.9-linux-x86_64.egg/qlib/data/init.py", line 8, in from .data import ( File "/home/yqm/miniconda3/lib/python3.9/site-packages/pyqlib-0.8.4.99-py3.9-linux-x86_64.egg/qlib/data/data.py", line 20, in from .cache import H File "/home/yqm/miniconda3/lib/python3.9/site-packages/pyqlib-0.8.4.99-py3.9-linux-x86_64.egg/qlib/data/cache.py", line 36, in from .ops import Operators # pylint: disable=W0611 # noqa: F401 File "/home/yqm/miniconda3/lib/python3.9/site-packages/pyqlib-0.8.4.99-py3.9-linux-x86_64.egg/qlib/data/ops.py", line 18, in from ._libs.rolling import rolling_slope, rolling_rsquare, rolling_resi ImportError: /home/yqm/miniconda3/lib/python3.9/site-packages/pyqlib-0.8.4.99-py3.9-linux-x86_64.egg/qlib/data/_libs/rolling.cpython-39-x86_64-linux-gnu.so: undefined symbol: _ZSt28__throw_bad_array_new_lengthv

I tried command " python setup.py build_ext --inplace " it backs

skipping 'qlib/data/_libs/rolling.cpp' Cython extension (up-to-date) skipping 'qlib/data/_libs/expanding.cpp' Cython extension (up-to-date) copying build/lib.linux-x86_64-3.9/qlib/data/_libs/rolling.cpython-39-x86_64-linux-gnu.so -> qlib/data/_libs copying build/lib.linux-x86_64-3.9/qlib/data/_libs/expanding.cpython-39-x86_64-linux-gnu.so -> qlib/data/_libs

but it didn't work , so I need help!

John-8911797110 avatar Apr 22 '22 09:04 John-8911797110

I resolved this error by

sudo apt remove gcc-11 g++-11
sudo apt install gcc-10 g++10

in your qlib dir sudo python setup.py install

John-8911797110 avatar Apr 22 '22 14:04 John-8911797110

I resolved this error by

sudo apt remove gcc-11 g++-11
sudo apt install gcc-10 g++10

in your qlib dir sudo python setup.py install

I tried buy it doesnt seems to be working. Any other workarounds ? https://hjlabs.in/

hemangjoshi37a avatar Apr 26 '22 03:04 hemangjoshi37a

John-8911797110 avatar Apr 26 '22 03:04 John-8911797110

check qlib/build has been upgraded or not. If upgrade, if you use a Pycharm, may be you need run

python setup.py build_ext --inplace

John-8911797110 avatar Apr 26 '22 03:04 John-8911797110

check qlib/build has been upgraded or not. If upgrade, if you use a Pycharm, may be you need run

python setup.py build_ext --inplace

It gives me output like this.

running build_ext
skipping 'qlib/data/_libs/rolling.cpp' Cython extension (up-to-date)
skipping 'qlib/data/_libs/expanding.cpp' Cython extension (up-to-date)
copying build/lib.linux-x86_64-3.8/qlib/data/_libs/rolling.cpython-38-x86_64-linux-gnu.so -> qlib/data/_libs

and still getting the same error ImportError: /home/hemang/anaconda3/lib/python3.8/site-packages/qlib/data/_libs/rolling.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZSt28__throw_bad_array_new_lengthv https://hjlabs.in/

hemangjoshi37a avatar Apr 26 '22 05:04 hemangjoshi37a

is your cython version wrong? mine is cython==3.0a1 . maybe install cython and then run install again. finally, check your site-packages/qlib/data/_libs/ , it should include 6 file:

expanding.cpp ; rolling.cpp
rolling.cpython-38-x86_64-linux-gnu.so;  expanding.cpython-38-x86_64-linux-gnu.so
rolling.pxy ;  expanding.pxy

John-8911797110 avatar Apr 26 '22 05:04 John-8911797110

Screenshot from 2022-04-26 16-37-38

is your cython version wrong? mine is cython==3.0a1 . maybe install cython and then run install again. finally, check your site-packages/qlib/data/_libs/ , it should include 6 file:

expanding.cpp ; rolling.cpp
rolling.cpython-38-x86_64-linux-gnu.so;  expanding.cpython-38-x86_64-linux-gnu.so
rolling.pxy ;  expanding.pxy

1 - As you can see in this picture I have all the six files in the folder. 2 - And also my cython==3.0a1 https://hjlabs.in/

hemangjoshi37a avatar Apr 26 '22 11:04 hemangjoshi37a

still getting the same error ImportError: /home/hemang/anaconda3/lib/python3.8/site-packages/qlib/data/_libs/rolling.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZSt28__throw_bad_array_new_lengthv https://hjlabs.in/

hemangjoshi37a avatar Apr 26 '22 11:04 hemangjoshi37a

@hemangjoshi37a Can you reproduce this error in a new Conda environment? If you can reproduce it consistently, please give more info about your environment. https://github.com/microsoft/qlib/blob/main/scripts/collect_info.py maybe helpful to you.

you-n-g avatar May 06 '22 10:05 you-n-g

@hemangjoshi37a Can you reproduce this error in a new Conda environment? If you can reproduce it consistently, please give more info about your environment. https://github.com/microsoft/qlib/blob/main/scripts/collect_info.py maybe helpful to you.

running : python3.8 collect_info.py all It gives me this output

(base) hemang@hemang-HP-Pavilion-g6-Notebook-PC:~/Downloads/notebook_scripts$ python3.8 collect_info.py all

Linux
x86_64
Linux-5.15.0-27-generic-x86_64-with-glibc2.10
#28-Ubuntu SMP Thu Apr 14 04:55:28 UTC 2022

Python version: 3.8.8 (default, Apr 13 2021, 19:58:26)  [GCC 7.3.0]

Qlib version: 0.8.5.99
numpy==1.19.5
pandas==1.1.5
scipy==1.4.1
requests==2.26.0
sacred==0.8.2
python-socketio==5.4.0
redis==3.5.3
python-redis-lock==3.7.0
schedule==1.1.0
cvxpy==1.2.0
hyperopt==0.2.5
fire==0.4.0
statsmodels==0.12.2
xlrd==1.1.0
plotly==5.7.0
matplotlib==3.5.0
tables==3.6.1
pyyaml==6.0
mlflow==1.25.1
tqdm==4.62.3
loguru==0.5.3
lightgbm==3.3.2
tornado==6.1
joblib==1.1.0
fire==0.4.0
ruamel.yaml==0.16.12

https://hjlabs.in/

hemangjoshi37a avatar May 13 '22 03:05 hemangjoshi37a

This issue is stale because it has been open for three months with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days

github-actions[bot] avatar Sep 04 '22 12:09 github-actions[bot]