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

numpy-2.0.1 and ta-lib-0.4.32 are compatible? #673

Open
Kammani opened this issue Aug 14, 2024 · 2 comments
Open

numpy-2.0.1 and ta-lib-0.4.32 are compatible? #673

Kammani opened this issue Aug 14, 2024 · 2 comments

Comments

@Kammani
Copy link

Kammani commented Aug 14, 2024

numpy-2.0.1 and ta-lib-0.4.32 are used . And tests.py is simple code as mentioned here .

import numpy as np
import talib

Check the versions to confirm the installation

print("NumPy version:", np.version)
print("TA-Lib version:", talib.version)

Example usage of TA-Lib

data = np.random.random(100) # Generate some random data
sma = talib.SMA(data, timeperiod=10) # Calculate a simple moving average

print("Simple Moving Average:", sma)

And the following message and Error appeared upon execution of tests.py file .
—————
Traceback (most recent call last):
File "/Users/Documents//testv.py", line 2, in
import talib
File "/Users//Documents//venv/lib/python3.12/site-packages/talib/init.py", line 93, in
from ._ta_lib import (
File "talib/_ta_lib.pyx", line 1, in init talib._ta_lib
ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject
——————-

Can you offer any solution ? Many thanks .

@mrjbq7
Copy link
Collaborator

mrjbq7 commented Aug 15, 2024 via email

@looker01202
Copy link

Try numpy v1.26.4. This solved the problem for my venv.

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

3 participants