Skip to content
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

导入包xalpha包,numpy报错问题 #188

Open
0xSchnappi opened this issue Aug 1, 2024 · 0 comments
Open

导入包xalpha包,numpy报错问题 #188

0xSchnappi opened this issue Aug 1, 2024 · 0 comments

Comments

@0xSchnappi
Copy link

python:3.10.12 64bit
numpy: 2.0.1

报错信息:
/root/develop/QuantitativeTrading/funds/venv/bin/python /root/develop/QuantitativeTrading/funds/GetFundsInfo.py ─╯
Traceback (most recent call last):
File "/root/develop/QuantitativeTrading/funds/GetFundsInfo.py", line 15, in
import xalpha as xa
File "/root/develop/QuantitativeTrading/funds/venv/lib/python3.10/site-packages/xalpha/init.py", line 5, in
import xalpha.policy
File "/root/develop/QuantitativeTrading/funds/venv/lib/python3.10/site-packages/xalpha/policy.py", line 5, in
import pandas as pd
File "/root/develop/QuantitativeTrading/funds/venv/lib/python3.10/site-packages/pandas/init.py", line 22, in
from pandas.compat import is_numpy_dev as _is_numpy_dev # pyright: ignore # noqa:F401
File "/root/develop/QuantitativeTrading/funds/venv/lib/python3.10/site-packages/pandas/compat/init.py", line 18, in
from pandas.compat.numpy import (
File "/root/develop/QuantitativeTrading/funds/venv/lib/python3.10/site-packages/pandas/compat/numpy/init.py", line 4, in
from pandas.util.version import Version
File "/root/develop/QuantitativeTrading/funds/venv/lib/python3.10/site-packages/pandas/util/init.py", line 2, in
from pandas.util._decorators import ( # noqa:F401
File "/root/develop/QuantitativeTrading/funds/venv/lib/python3.10/site-packages/pandas/util/_decorators.py", line 14, in
from pandas._libs.properties import cache_readonly
File "/root/develop/QuantitativeTrading/funds/venv/lib/python3.10/site-packages/pandas/_libs/init.py", line 13, in
from pandas._libs.interval import Interval
File "pandas/_libs/interval.pyx", line 1, in init pandas._libs.interval
ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

修复办法:
https://stackoverflow.com/questions/78634235/numpy-dtype-size-changed-may-indicate-binary-incompatibility-expected-96-from

pip3 uninstall numpy 
pip3 install numpy==1.26.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant