ModuleNotFoundError: No module named 'talib'
Asked Answered
S

3

6

Cannot install ta-lib on MacOS.

pip install ta-lib

How to install it?

Segura answered 18/3, 2021 at 8:53 Comment(0)
S
8

Try:

brew install ta-lib
pip install ta-lib

Source: https://github.com/enigmampc/catalyst/issues/187#issuecomment-374552524

Segura answered 18/3, 2021 at 8:54 Comment(1)
Failed to build ta-lib ERROR: Could not build wheels for ta-lib, which is required to install pyproject.toml-based projectsRedbreast
O
3

Faced the issue on Big sur again

The situation: brew install ta-lib was successful and so was pip install TA-Lib version 0.4.19

On console:

   >>> import talib

   Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   ModuleNotFoundError: No module named 'talib'`

Solution: Installing from source worked for me, here are the steps

  • Install ta-lib using homebrew brew install ta-lib, this is required

  • Download the source from TALIB_SOURCE

  • untar/unzip the download ( tar -xvzf mrjbq7-ta-lib-TA_Lib-0.4.19-19-g5eb3fa4.tar.gz

  • cd into the folder and run:

pip install -r requirements.txt 
python setup.py install

import talib should be working now

Office answered 4/4, 2021 at 6:45 Comment(0)
H
2

Here is the solution that usually works for me. In the file you are trying to import the module copy and paste the following code and run it. Then you will be ready to go.

from pip._internal import main as install

install(["install","ta-lib"])

Hope this will work for you, Good luck.

Hance answered 18/3, 2021 at 9:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.