Skip to content

talib/__init__.py need to be updated #706

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
richardhuo opened this issue Feb 9, 2025 · 7 comments
Open

talib/__init__.py need to be updated #706

richardhuo opened this issue Feb 9, 2025 · 7 comments

Comments

@richardhuo
Copy link

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 richardhuo reopened this Feb 10, 2025
@richardhuo
Copy link
Author

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

@richardhuo
Copy link
Author

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.

@mrjbq7
Copy link
Member

mrjbq7 commented Feb 11, 2025

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
Copy link
Member

mrjbq7 commented Feb 11, 2025

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

@richardhuo
Copy link
Author

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.

@mrjbq7
Copy link
Member

mrjbq7 commented Feb 11, 2025

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

@richardhuo
Copy link
Author

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

0.6.4

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