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

talib/__init__.py need to be updated

Open richardhuo opened this issue 1 year ago • 7 comments

Python 3.13.1 (main, Feb 9 2025, 06:28:54) [GCC 11.4.0] on linux Type "help", "copyright", "credits" or "license" for more information.

import talib Traceback (most recent call last): File "", line 1, in import talib File "/home/xxxxx/ta-lib-python/talib/init.py", line 109, in from ._ta_lib import ( ...<6 lines>... ) ModuleNotFoundError: No module named 'talib._ta_lib'

after change it to from ._ta_lib to ._ta-lib import, talib can be imported successfully.

richardhuo avatar Feb 09 '25 07:02 richardhuo

In the same init.py file there is another from ._ta_lib import * at line 119 passed without any issue. wondering why.

richardhuo avatar Feb 10 '25 10:02 richardhuo

thinking of that from ._ta_lib import * can do everything with this from ._ta_lib import ( ...<6 lines>... ), so I simply remove these from ._ta_lib import ( ...<6 lines>... ). it works.

richardhuo avatar Feb 10 '25 13:02 richardhuo

I don't understand why your module would be _ta-lib, its building talib/_ta_lib.c and making something like _ta_lib.cpython-311-darwin.so

$ ls talib
__init__.py                    _ta_lib.c                      abstract.py
__pycache__/                   _ta_lib.cpython-311-darwin.so* common.pxd
_abstract.pxi                  _ta_lib.cpython-312-darwin.so* deprecated.py
_common.pxi                    _ta_lib.pxd                    py.typed
_func.pxi                      _ta_lib.pyi                    stream.py
_stream.pxi                    _ta_lib.pyx

mrjbq7 avatar Feb 11 '25 00:02 mrjbq7

Usually that error indicates the installation didn't finish compiling properly, usually indicative of missing dependencies.

mrjbq7 avatar Feb 11 '25 00:02 mrjbq7

That's right. I tried again from windows using installation from source, and this time it did work. The error message I received when tried to do the same from Linux/ubuntu. anyway. 0.6.1 works perfect for me.

richardhuo avatar Feb 11 '25 10:02 richardhuo

what version of the underlying TA-Lib C library do you have?

mrjbq7 avatar Feb 11 '25 19:02 mrjbq7

what version of the underlying TA-Lib C library do you have?

0.6.4

richardhuo avatar Feb 11 '25 23:02 richardhuo