-
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
Unable to build docker image with TA-Lib #655
Comments
Had the same error. If I clone the repo and install using |
I met a similar error but on google colab, here's the link: https://colab.research.google.com/drive/1DzJbfYvfro4Iulb0PZLwrIegNKjrfrBG?usp=sharing ...
building 'talib._ta_lib' extension
creating build/temp.linux-x86_64-cpython-310
creating build/temp.linux-x86_64-cpython-310/talib
x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include -I/usr/local/include -I/opt/include -I/opt/local/include -I/opt/homebrew/include -I/opt/homebrew/opt/ta-lib/include -I/tmp/pip-build-env-e5ra00kj/normal/local/lib/python3.10/dist-packages/numpy/_core/include -I/usr/include/python3.10 -c talib/_ta_lib.c -o build/temp.linux-x86_64-cpython-310/talib/_ta_lib.o
In file included from /tmp/pip-build-env-e5ra00kj/normal/local/lib/python3.10/dist-packages/numpy/_core/include/numpy/ndarraytypes.h:1909,
from /tmp/pip-build-env-e5ra00kj/normal/local/lib/python3.10/dist-packages/numpy/_core/include/numpy/ndarrayobject.h:12,
from /tmp/pip-build-env-e5ra00kj/normal/local/lib/python3.10/dist-packages/numpy/_core/include/numpy/arrayobject.h:5,
from talib/_ta_lib.c:1235:
/tmp/pip-build-env-e5ra00kj/normal/local/lib/python3.10/dist-packages/numpy/_core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
17 | #warning "Using deprecated NumPy API, disable it with " \
| ^~~~~~~
In file included from /usr/include/python3.10/Python.h:74,
from talib/_ta_lib.c:16:
talib/_ta_lib.c: In function ‘__pyx_f_5numpy_PyDataType_SHAPE’:
talib/_ta_lib.c:10268:39: error: ‘PyArray_Descr’ {aka ‘struct _PyArray_Descr’} has no member named ‘subarray’
10268 | __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
| ^~
/usr/include/python3.10/object.h:112:41: note: in definition of macro ‘_PyObject_CAST’
112 | #define _PyObject_CAST(op) ((PyObject*)(op))
| ^~
talib/_ta_lib.c:1657:27: note: in expansion of macro ‘Py_INCREF’
1657 | #define __Pyx_INCREF(r) Py_INCREF(r)
| ^~~~~~~~~
talib/_ta_lib.c:10268:5: note: in expansion of macro ‘__Pyx_INCREF’
10268 | __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
| ^~~~~~~~~~~~
talib/_ta_lib.c:10269:36: error: ‘PyArray_Descr’ {aka ‘struct _PyArray_Descr’} has no member named ‘subarray’
10269 | __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
| ^~
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
error: subprocess-exited-with-error
× Building wheel for TA-Lib (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
full command: /usr/bin/python3 /usr/local/lib/python3.10/dist-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /tmp/tmpss6hjp6m
cwd: /tmp/pip-install-j_7fber9/ta-lib_c0f5c13d1a544769979ccb300e217551
Building wheel for TA-Lib (pyproject.toml) ... error
ERROR: Failed building wheel for TA-Lib
Failed to build TA-Lib
ERROR: Could not build wheels for TA-Lib, which is required to install pyproject.toml-based projects Reproduce Steps!wget https://sourceforge.net/projects/ta-lib/files/ta-lib/0.4.0/ta-lib-0.4.0-src.tar.gz
!tar -xzf ta-lib-0.4.0-src.tar.gz
%cd ta-lib/
!./configure --prefix=/usr
!make
!sudo make install
%cd .. !python -m pip install TA-Lib -v |
What changed is (most likely) the release of numpy2 - causing some incompatibilities with ta-lib. it should be installable via the following sequence:
root cause: A short-term fix to this is probably pinning numpy to <2.0.0 in pyproject.toml (in the build-requires section - can't remember the name rn). |
I'm also experiencing the same issue using During my research, I stumbled upon this issue: numpy/numpy#21865 (comment) It seems that adding the necessary annotation |
|
If this is the numpy2 issue, then it's fixed as of release 0.4.31 this morning. If this is related to the NPY_1_7_API_VERSION thing, perhaps we can fix that too later. |
I'm having this issue also when using numpy |
same issue here -> https://github.com/quantbelt/jupyter-quant/actions/runs/9546855109/job/26319548842 i'm pinning numpy, so it's not related to numpy v2 tested with |
I confirm that 0.4.31 fixes the issue for amd64 and arm64 |
0.4.31 fixed problem |
0.4.31 fixed here too |
Describe the bug
Unable to build the docker image - not sure what changed, but now i'm getting these errors:
To Reproduce
Steps to reproduce the behavior:
Dockerfile
Desktop:
The text was updated successfully, but these errors were encountered: