ta-lib-python icon indicating copy to clipboard operation
ta-lib-python copied to clipboard

Numpy incompatible with Talib

Open JerryYin7 opened this issue 1 year ago • 7 comments

Hi, After I downloaded talib, there is no way for me to run my code. There will be the error message that: File "/Users/guangzhouzuihoudehaonanren/Desktop/intern/intern.py", line 2, in import backtrader as bt File "/Users/guangzhouzuihoudehaonanren/Desktop/intern/quant/lib/python3.12/site-packages/backtrader/init.py", line 86, in from . import talib as talib File "/Users/guangzhouzuihoudehaonanren/Desktop/intern/quant/lib/python3.12/site-packages/backtrader/talib.py", line 34, in import talib File "/Users/guangzhouzuihoudehaonanren/Desktop/intern/quant/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 Thanks!!!

JerryYin7 avatar Jul 04 '24 01:07 JerryYin7

What version of numpy are you using?

mrjbq7 avatar Jul 04 '24 02:07 mrjbq7

What version of numpy are you using?

2.0.0

JerryYin7 avatar Jul 04 '24 02:07 JerryYin7

We do not currently support numpy 2

There are pending issues with cython to support it that need fixing first.

On Wed, Jul 3, 2024 at 8:39 PM JerryYin7 @.***> wrote:

What version of numpy are you using?

2.0.0

— Reply to this email directly, view it on GitHub https://github.com/TA-Lib/ta-lib-python/issues/661#issuecomment-2207900343, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAF5A5UILN2N5NPCVN5XZDZKSYW7AVCNFSM6AAAAABKKRZO5CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBXHEYDAMZUGM . You are receiving this because you commented.Message ID: @.***>

mrjbq7 avatar Jul 04 '24 02:07 mrjbq7

What version should we use? Just downgraded to 1.26.4 and still having issues. Thanks!

michaelpeck avatar Jul 20 '24 17:07 michaelpeck

It should work with any numpy < 2.

What issues are you having?

mrjbq7 avatar Jul 20 '24 17:07 mrjbq7

What version should we use? Just downgraded to 1.26.4 and still having issues. Thanks!

"numpy==1.19.5" will sovle this issue

pinnnkman avatar Jul 21 '24 12:07 pinnnkman

I got mine working in a python 3.12 venv, after installing numpy 1.26.4, and talib 0.4.32 Other errors come up now of course, but talib / numpy might be happy now. we'll see....

dalklein avatar Oct 18 '24 01:10 dalklein

Released ta-lib 0.5.0 with numpy 2.0 support.

Also released ta-lib 0.4.33 with numpy<2.0 support.

mrjbq7 avatar Nov 13 '24 17:11 mrjbq7