Skip to content
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

Cannot find ta-lib library, installation may fail. (and does) #158

Closed
ParityError opened this issue Mar 24, 2021 · 3 comments
Closed

Cannot find ta-lib library, installation may fail. (and does) #158

ParityError opened this issue Mar 24, 2021 · 3 comments

Comments

@ParityError
Copy link

When I try to install on macOS 10.14.6 with Python 3.7 installed I get an error that TA-Lib cannot be found:

# first, make sure that the PyPi version is not installed
pip uninstall jesse

# now install Jesse from the repository
git clone https://github.com/jesse-ai/jesse.git
cd jesse
pip install -e .

Error output:

  Running setup.py clean for TA-Lib
  Building wheel for timeloop (setup.py) ... done
  Created wheel for timeloop: filename=timeloop-1.0.2-py3-none-any.whl size=3720 sha256=5433fd31956a17cc1d0cc624344279d6b2a56f27e3daf63b132036407ed44180
  Stored in directory: /private/tmp/pip-ephem-wheel-cache-opaqwm4j/wheels/3a/7e/fc/5e4d6da12b9ab6550604412936723ec6f2faf7391dd6726a01
Successfully built blinker newtulipy peewee timeloop
Failed to build TA-Lib
Installing collected packages: blinker, pytz, pandas, pandas-datareader, scipy, crypto-empyrical, pyparsing, kiwisolver, cycler, matplotlib, newtulipy, peewee, psycopg2-binary, pydash, iniconfig, packaging, py, zipp, importlib-metadata, pluggy, toml, pytest, TA-Lib, tabulate, timeloop, websocket-client, jesse
    Running setup.py install for TA-Lib ... error
    ERROR: Command errored out with exit status 1:
     command: /opt/local/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-j9q6vmja/TA-Lib/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-j9q6vmja/TA-Lib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/tmp/pip-record-lm5732up/install-record.txt --single-version-externally-managed --compile --install-headers /opt/local/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m/TA-Lib
         cwd: /private/tmp/pip-install-j9q6vmja/TA-Lib/
    Complete output (27 lines):
    /private/tmp/pip-install-j9q6vmja/TA-Lib/setup.py:71: UserWarning: Cannot find ta-lib library, installation may fail.
      warnings.warn('Cannot find ta-lib library, installation may fail.')
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.14-x86_64-3.7
    creating build/lib.macosx-10.14-x86_64-3.7/talib
    copying talib/abstract.py -> build/lib.macosx-10.14-x86_64-3.7/talib
    copying talib/test_abstract.py -> build/lib.macosx-10.14-x86_64-3.7/talib
    copying talib/deprecated.py -> build/lib.macosx-10.14-x86_64-3.7/talib
    copying talib/__init__.py -> build/lib.macosx-10.14-x86_64-3.7/talib
    copying talib/stream.py -> build/lib.macosx-10.14-x86_64-3.7/talib
    copying talib/test_pandas.py -> build/lib.macosx-10.14-x86_64-3.7/talib
    copying talib/test_data.py -> build/lib.macosx-10.14-x86_64-3.7/talib
    copying talib/test_func.py -> build/lib.macosx-10.14-x86_64-3.7/talib
    copying talib/test_stream.py -> build/lib.macosx-10.14-x86_64-3.7/talib
    running build_ext
    building 'talib._ta_lib' extension
    creating build/temp.macosx-10.14-x86_64-3.7
    creating build/temp.macosx-10.14-x86_64-3.7/talib
    /usr/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -pipe -Os -I/usr/include -I/usr/local/include -I/opt/include -I/opt/local/include -I/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include -I/opt/local/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c talib/_ta_lib.c -o build/temp.macosx-10.14-x86_64-3.7/talib/_ta_lib.o
    talib/_ta_lib.c:611:10: fatal error: 'ta-lib/ta_defs.h' file not found
    #include "ta-lib/ta_defs.h"
             ^~~~~~~~~~~~~~~~~~
    1 error generated.
    error: command '/usr/bin/clang' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /opt/local/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-j9q6vmja/TA-Lib/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-j9q6vmja/TA-Lib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/tmp/pip-record-lm5732up/install-record.txt --single-version-externally-managed --compile --install-headers /opt/local/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m/TA-Lib Check the logs for full command output.
@ParityError
Copy link
Author

ParityError commented Mar 24, 2021

The error is caused because my Python is installed with MacPorts.

The solution is to:

$ sudo port install ta-lib

@cryptocoinserver
Copy link
Collaborator

Did you follow the steps in the docs?
https://docs.jesse.trade/docs/getting-started/environment-setup.html#macos

@ParityError
Copy link
Author

ParityError commented Mar 24, 2021

@cryptocoinserver, It would be helpful to include instructions in the document you linked for people using MacPorts as not everyone uses Homebrew on macOS.

~ Cheers

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