Skip to content

Macbook M1 ERROR: Failed to build installable wheels for some pyproject.toml based projects (ta-lib) #720

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

Open
25370025 opened this issue Apr 9, 2025 · 6 comments

Comments

@25370025
Copy link

25370025 commented Apr 9, 2025

I followed your guide on OS.

  1. arch -arm64 brew install ta-lib [DONE]

==> Downloading https://mirrors.aliyun.com/homebrew/homebrew-bottles/api/formula.jws.json
==> Downloading https://mirrors.aliyun.com/homebrew/homebrew-bottles/api/cask.jws.json
Warning: ta-lib 0.6.4 is already installed and up-to-date.

  1. export [DONE]
    $ export TA_INCLUDE_PATH="$(brew --prefix ta-lib)/include"
    $ export TA_LIBRARY_PATH="$(brew --prefix ta-lib)/lib"

  2. run "python3 -m pip install --no-cache-dir ta-lib" [FAILED]

Defaulting to user installation because normal site-packages is not writeable
Collecting ta-lib
Downloading ta_lib-0.6.3.tar.gz (376 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: setuptools in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages (from ta-lib) (41.2.0)
Collecting numpy (from ta-lib)
Downloading numpy-1.24.4-cp38-cp38-macosx_11_0_arm64.whl.metadata (5.6 kB)
Downloading numpy-1.24.4-cp38-cp38-macosx_11_0_arm64.whl (13.8 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 13.8/13.8 MB 6.9 MB/s eta 0:00:00
Building wheels for collected packages: ta-lib
Building wheel for ta-lib (pyproject.toml) ... error
error: subprocess-exited-with-error

× Building wheel for ta-lib (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [108 lines of output]
running bdist_wheel
running build
running build_py
creating build/lib.macosx-10.14.6-arm64-cpython-38/talib
copying talib/abstract.py -> build/lib.macosx-10.14.6-arm64-cpython-38/talib
copying talib/deprecated.py -> build/lib.macosx-10.14.6-arm64-cpython-38/talib
copying talib/init.py -> build/lib.macosx-10.14.6-arm64-cpython-38/talib
copying talib/stream.py -> build/lib.macosx-10.14.6-arm64-cpython-38/talib
running egg_info
writing ta_lib.egg-info/PKG-INFO
writing dependency_links to ta_lib.egg-info/dependency_links.txt
writing requirements to ta_lib.egg-info/requires.txt
writing top-level names to ta_lib.egg-info/top_level.txt
reading manifest file 'ta_lib.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE'
adding license file 'AUTHORS'
writing manifest file 'ta_lib.egg-info/SOURCES.txt'
copying talib/_abstract.pxi -> build/lib.macosx-10.14.6-arm64-cpython-38/talib
copying talib/_common.pxi -> build/lib.macosx-10.14.6-arm64-cpython-38/talib
copying talib/_func.pxi -> build/lib.macosx-10.14.6-arm64-cpython-38/talib
copying talib/_stream.pxi -> build/lib.macosx-10.14.6-arm64-cpython-38/talib
copying talib/_ta_lib.c -> build/lib.macosx-10.14.6-arm64-cpython-38/talib
copying talib/_ta_lib.pyi -> build/lib.macosx-10.14.6-arm64-cpython-38/talib
copying talib/_ta_lib.pyx -> build/lib.macosx-10.14.6-arm64-cpython-38/talib
copying talib/py.typed -> build/lib.macosx-10.14.6-arm64-cpython-38/talib
running build_ext
building 'talib._ta_lib' extension
creating build/temp.macosx-10.14.6-arm64-cpython-38/talib
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -I/opt/homebrew/opt/ta-lib/include -I/private/var/folders/wj/5n2_4syj2vl0m2f49kkn390w0000gn/T/pip-build-env-dkyx6v_n/normal/lib/python3.8/site-packages/numpy/core/include -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c talib/_ta_lib.c -o build/temp.macosx-10.14.6-arm64-cpython-38/talib/_ta_lib.o
In file included from talib/_ta_lib.c:1235:
In file included from /private/var/folders/wj/5n2_4syj2vl0m2f49kkn390w0000gn/T/pip-build-env-dkyx6v_n/normal/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5:
In file included from /private/var/folders/wj/5n2_4syj2vl0m2f49kkn390w0000gn/T/pip-build-env-dkyx6v_n/normal/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12:
In file included from /private/var/folders/wj/5n2_4syj2vl0m2f49kkn390w0000gn/T/pip-build-env-dkyx6v_n/normal/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940:
/private/var/folders/wj/5n2_4syj2vl0m2f49kkn390w0000gn/T/pip-build-env-dkyx6v_n/normal/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
#warning "Using deprecated NumPy API, disable it with "
^
talib/_ta_lib.c:10174:13: error: implicit declaration of function 'PyDataType_ELSIZE' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
__pyx_r = PyDataType_ELSIZE(__pyx_v_self);
^
talib/_ta_lib.c:10187:13: error: implicit declaration of function 'PyDataType_ALIGNMENT' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
__pyx_r = PyDataType_ALIGNMENT(__pyx_v_self);
^
talib/_ta_lib.c:10204:15: error: implicit declaration of function 'PyDataType_FIELDS' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
__pyx_t_1 = PyDataType_FIELDS(__pyx_v_self);
^
talib/_ta_lib.c:10204:13: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
__pyx_t_1 = PyDataType_FIELDS(__pyx_v_self);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
talib/_ta_lib.c:10225:15: error: implicit declaration of function 'PyDataType_NAMES' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
__pyx_t_1 = PyDataType_NAMES(__pyx_v_self);
^
talib/_ta_lib.c:10225:13: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
__pyx_t_1 = PyDataType_NAMES(__pyx_v_self);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
talib/_ta_lib.c:10242:13: error: implicit declaration of function 'PyDataType_SUBARRAY' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
__pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
^
talib/_ta_lib.c:10242:11: warning: incompatible integer to pointer conversion assigning to 'PyArray_ArrayDescr *' (aka 'struct _arr_descr *') from 'int' [-Wint-conversion]
__pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
talib/_ta_lib.c:10255:13: error: implicit declaration of function 'PyDataType_FLAGS' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
__pyx_r = PyDataType_FLAGS(__pyx_v_self);
^
talib/_ta_lib.c:10268:13: error: implicit declaration of function 'PyArray_MultiIter_NUMITER' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
__pyx_r = PyArray_MultiIter_NUMITER(__pyx_v_self);
^
talib/_ta_lib.c:10281:13: error: implicit declaration of function 'PyArray_MultiIter_SIZE' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
__pyx_r = PyArray_MultiIter_SIZE(__pyx_v_self);
^
talib/_ta_lib.c:10294:13: error: implicit declaration of function 'PyArray_MultiIter_INDEX' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
__pyx_r = PyArray_MultiIter_INDEX(__pyx_v_self);
^
talib/_ta_lib.c:10307:13: error: implicit declaration of function 'PyArray_MultiIter_NDIM' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
__pyx_r = PyArray_MultiIter_NDIM(__pyx_v_self);
^
talib/_ta_lib.c:10320:13: error: implicit declaration of function 'PyArray_MultiIter_DIMS' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
__pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self);
^
talib/_ta_lib.c:10320:11: warning: incompatible integer to pointer conversion assigning to 'npy_intp *' (aka 'long *') from 'int' [-Wint-conversion]
__pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
talib/_ta_lib.c:10333:13: error: implicit declaration of function 'PyArray_MultiIter_ITERS' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
__pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self);
^
talib/_ta_lib.c:10333:11: warning: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion]
__pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
talib/_ta_lib.c:101887:76: warning: code will never be executed [-Wunreachable-code]
if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad;
^~~~~~~~
talib/_ta_lib.c:101887:73: note: silence by adding parentheses to mark code as explicitly dead
if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad;
^
/
DISABLES CODE */ ( )
talib/_ta_lib.c:105008:5: warning: 'tp_print' is deprecated [-Wdeprecated-declarations]
0,
^
/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/cpython/object.h:260:5: note: 'tp_print' has been explicitly marked deprecated here
Py_DEPRECATED(3.8) int (*tp_print)(PyObject *, FILE *, int);
^
/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/pyport.h:515:54: note: expanded from macro 'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated))
^
8 warnings and 12 errors generated.
/private/var/folders/wj/5n2_4syj2vl0m2f49kkn390w0000gn/T/pip-build-env-dkyx6v_n/overlay/lib/python3.8/site-packages/setuptools/config/_apply_pyprojecttoml.py:78: SetuptoolsWarning: install_requires overwritten in pyproject.toml (dependencies)
corresp(dist, value, root_dir)
error: command '/usr/bin/clang' failed with exit code 1
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for ta-lib
Failed to build ta-lib
ERROR: Failed to build installable wheels for some pyproject.toml based projects (ta-lib)

@25370025
Copy link
Author

25370025 commented Apr 9, 2025

some supplement:

Python 3.8.2 (default, Apr 8 2021, 23:19:18)

@25370025
Copy link
Author

25370025 commented Apr 9, 2025

More supplement.

  1. Running on Terminal still failed.

2.Running on the JupyterLab seems ok. Will take this as a workaround at this moment.

!pip install --no-cache-dir ta-lib

Collecting ta-lib
Downloading ta_lib-0.6.3.tar.gz (376 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: setuptools in /Users/jerry/Library/jupyterlab-desktop/jlab_server/lib/python3.12/site-packages (from ta-lib) (72.2.0)
Requirement already satisfied: numpy in /Users/jerry/Library/jupyterlab-desktop/jlab_server/lib/python3.12/site-packages (from ta-lib) (2.2.4)
Building wheels for collected packages: ta-lib
Building wheel for ta-lib (pyproject.toml) ... done
Created wheel for ta-lib: filename=ta_lib-0.6.3-cp312-cp312-macosx_11_0_arm64.whl size=773170 sha256=acd131604b62589cbf6174b03965bc6c8358f62a1534bddab176c4f78ce8b438
Stored in directory: /private/var/folders/wj/5n2_4syj2vl0m2f49kkn390w0000gn/T/pip-ephem-wheel-cache-5vd2nqtm/wheels/f6/4a/68/1262c0ee1c6b48843d6ddefdeb680b6d4fe24f5cf9e3bae917
Successfully built ta-lib
Installing collected packages: ta-lib
Successfully installed ta-lib-0.6.3

@mrjbq7
Copy link
Member

mrjbq7 commented Apr 9, 2025 via email

@25370025
Copy link
Author

25370025 commented Apr 9, 2025

Thanks for the reply.

Actually I tried 0.4.38 in Terminal as below before but hit the same error.
"python3 -m pip install --no-cache-dir ta-lib==0.4.38"

@mrjbq7
Copy link
Member

mrjbq7 commented Apr 9, 2025 via email

@25370025
Copy link
Author

25370025 commented Apr 9, 2025

Thanks for your new info.

As the JupyterLab one works now and I'll finished my task first, then try your suggestion later.

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

2 participants