-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject #378
Comments
Am having this issue as well on my server, but not on local Ubuntu. Have u found a fix? |
I suspect it’s an issue with pip being different than the Python you want to use.
Try this:
python3.9 -m pip install ta-lib
(Replace python3.9 with whichever Python you are using )
… On Jan 7, 2021, at 7:04 AM, Emmanuel Iturbide ***@***.***> wrote:
Hello,
I'm trying to use TA-lib on my Ubuntu 18.04 instance.
I installed the package using
sudo ./configure
sudo make
sudo make install
and then install ta-lib using pip install ta-lib
When I try to import talib, I got the following error:
>>> import talib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/user/user/virtualenv/lib/python3.7/site-packages/talib/__init__.py", line 52, in <module>
from ._ta_lib import (
File "talib/_ta_lib.pyx", line 1, in init talib._ta_lib
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject
The only recommendation I found on internet was to install python 3.8 which isn't a possibility for me right now (to many dependencies on my project).
Any idea what's the issue could be ?
Thanks in advance.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Updated python3 to python3.8 and now the error is not there anymore |
Updating |
You might wanna reference pypa/pip#9542 regarding this, as the pip build-behaviour that's causing this is being discussed there. |
I ran into this as well. Looks like updating to numpy==1.20.0 does indeed resolve it but I'm wondering if it will break again the next time numpy puts out another release. Is the issue here that ta-lib is being installed against the latest available version of numpy which may be different from the version of numpy installed in the runtime environment? |
numpy is ABI forward compatible - so if you got ta-lib installed once, it'll work, as a new version will always be newer. During build time, pip installs the latest version (see issue above) in the build environment. If your environment then has a older version, it may break (as shown here). Apparently, this can be fixed by changing the build-dependency to |
@mrjbq7 using |
this sucks since tensorflow-macos 2.5 is tied to 1.19 |
What’s the issue?
This Python project doesn’t require new numpy, although the C file that is checked in might be generated with new numpy.
Nothing stops using Cython to generate and install it with other numpy versions?
… On Sep 19, 2021, at 3:26 PM, Manuel Schneider ***@***.***> wrote:
I ran into this as well. Looks like updating to numpy==1.20.0 does indeed resolve it but I'm wondering if it will break again the next time numpy puts out another release.
this sucks since tensorflow-macos 2.5 is tied to 1.19
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
I’m currently trying to build a Docker container with some libraries, between them are: The problem is that some library requires
That binary incompatibility was fixed in There is any way to build a Docker container with |
Should work fine. You might need to regenerate the C files using Cython.
You can run “make cython” to do that
… On Nov 13, 2021, at 9:19 AM, Maximo Ripani ***@***.***> wrote:
I’m currently trying to build a Docker container with some libraries, between them are: numpy ;ta-lib.
The problem is that some library requires numpy<1.19 and when using that version of numpy presents this error:
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from
PyObject
Those binary incompatibility where fixed in numpy>=1.20, but I can't use that version of numpy because another dependencies.
Therre is any way to build a Docker container with ta-lib and numpy<=1.19?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
I already tried it. Another error appeared:
|
I dunno about your Docker integration, but it's there:
But maybe that's not the way to fix it -- the next release will no longer specify a numpy version, which might make it easier to support various combinations of versions. |
Hello! I'm steel dealing with the error
I'm currently using To solve the error I should update to Is possible to work with TA-Lib and |
I don't specify a version of numpy that's required. |
Have you tried doing a git checkout and installing from That would allow you to regenerate the C bindings for your local numpy version ( |
I had the same problem and could solve it by updating the numpy:
I have ta-lib==0.4.24 and numpy==1.22.3
|
I generate the C files using latest numpy and cython.
Maybe you need to regenerate them for your numpy version.
$ make cython
$ python setup.py install
… On Mar 29, 2022, at 11:43 AM, Keivan ***@***.***> wrote:
I had the same problem and could solve it by updating the numpy:
pip install --upgrade numpy
I have ta-lib==0.4.24 and numpy==1.22.3
Hello,
I'm trying to use TA-lib on my Ubuntu 18.04 instance. I installed the package using
sudo ./configure
sudo make
sudo make install
and then install ta-lib using pip install ta-lib
When I try to import talib, I got the following error:
>>> import talib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/user/user/virtualenv/lib/python3.7/site-packages/talib/__init__.py", line 52, in <module>
from ._ta_lib import (
File "talib/_ta_lib.pyx", line 1, in init talib._ta_lib
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject
The only recommendation I found on internet was to install python 3.8 which isn't a possibility for me right now (to many dependencies on my project). Any idea what's the issue could be ?
Thanks in advance.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
|
its WORKED with me :) |
Same, |
old thread, but same issue? I have python3.12, numpy-2.1.2 and TA-Lib-0.4.32
|
The fix here seemed to have worked for me |
Hello,
I'm trying to use TA-lib on my Ubuntu 18.04 instance.
I installed the package using
and then install ta-lib using pip install ta-lib
When I try to import talib, I got the following error:
The only recommendation I found on internet was to install python 3.8 which isn't a possibility for me right now (to many dependencies on my project).
Any idea what's the issue could be ?
Thanks in advance.
The text was updated successfully, but these errors were encountered: