I'm trying to use both TA-lib version 0.4.21 and Tensorflow 2.6.0 in the same project. Both require different numpy versions: TF ~= 1.19.2 TA-lib >= 1.19.4
Given those dependencies, numpy 1.19.4 or 1.19.5 should work just fine, but I get the following exception:
numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject
I tried uninstalling and installing numpy 1.19.4 and 1.19.5 several times, on python 3.8 and 3.9 but the result is the same.
Removing TF and using latest version on numpy resolves the issue - but this isn't a solution for me.
Didn't find anything online about this collision between the two libraries.
Will be glad for help, thanks!
Try to install numpy first with:
pip install numpy==1.19.5 # This the TF version.
Than compile and install TA-lib:
# downloag tar.gz file
./configure
make
make install
pip install TA-lib --no-binary TA-lib
You will rebuild the package with the outdated numpy C API usage.
It worked here in ubuntu 20.04.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With