无法在出现pip和m的ubuntu错误时安装Talib

2021-04-11 15:45:41 发布

您现在位置:Python中文网/ 问答频道 /正文

我尝试过一些替代方法,但是我不能在我的ubuntu上安装ta lib或使用make

pip install ta-Lib

Collecting ta-Lib
  Using cached https://files.pythonhosted.org/packages/90/05/d4c6a778d7a7de0be366bc4a850b4ffaeac2abad927f95fa8ba6f355a082/TA-Lib-0.4.17.tar.gz
Requirement already satisfied: numpy in ./miniconda3/lib/python3.6/site-packages (from ta-Lib) (1.15.0)
Building wheels for collected packages: ta-Lib
  Running setup.py bdist_wheel for ta-Lib ... error
  Complete output from command /home/user/miniconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-ugk06wz4/ta-Lib/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-v2gctt6z --python-tag cp36:
  /tmp/pip-install-ugk06wz4/ta-Lib/setup.py:79: UserWarning: Cannot find ta-lib library, installation may fail.
    warnings.warn('Cannot find ta-lib library, installation may fail.')
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.6
  creating build/lib.linux-x86_64-3.6/talib
  copying talib/stream.py -> build/lib.linux-x86_64-3.6/talib
  copying talib/deprecated.py -> build/lib.linux-x86_64-3.6/talib
  copying talib/abstract.py -> build/lib.linux-x86_64-3.6/talib
  copying talib/test_stream.py -> build/lib.linux-x86_64-3.6/talib
  copying talib/test_abstract.py -> build/lib.linux-x86_64-3.6/talib
  copying talib/test_data.py -> build/lib.linux-x86_64-3.6/talib
  copying talib/__init__.py -> build/lib.linux-x86_64-3.6/talib
  copying talib/test_pandas.py -> build/lib.linux-x86_64-3.6/talib
  copying talib/test_func.py -> build/lib.linux-x86_64-3.6/talib
  running build_ext
  building 'talib._ta_lib' extension
  creating build/temp.linux-x86_64-3.6
  creating build/temp.linux-x86_64-3.6/talib
  gcc -pthread -B /home/user/miniconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/user/miniconda3/lib/python3.6/site-packages/numpy/core/include -I/usr/include -I/usr/local/include -I/opt/include -I/opt/local/include -I/home/user/miniconda3/include/python3.6m -c talib/_ta_lib.c -o build/temp.linux-x86_64-3.6/talib/_ta_lib.o
  talib/_ta_lib.c:526:10: fatal error: ta-lib/ta_defs.h: No such file or directory
   #include "ta-lib/ta_defs.h"
            ^~~~~~~~~~~~~~~~~~
  compilation terminated.
  error: command 'gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for ta-Lib
  Running setup.py clean for ta-Lib
Failed to build ta-Lib
Installing collected packages: ta-Lib
  Running setup.py install for ta-Lib ... error
    Complete output from command /home/user/miniconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-ugk06wz4/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 /tmp/pip-record-kipfzx36/install-record.txt --single-version-externally-managed --compile:
    /tmp/pip-install-ugk06wz4/ta-Lib/setup.py:79: 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.linux-x86_64-3.6
    creating build/lib.linux-x86_64-3.6/talib
    copying talib/stream.py -> build/lib.linux-x86_64-3.6/talib
    copying talib/deprecated.py -> build/lib.linux-x86_64-3.6/talib
    copying talib/abstract.py -> build/lib.linux-x86_64-3.6/talib
    copying talib/test_stream.py -> build/lib.linux-x86_64-3.6/talib
    copying talib/test_abstract.py -> build/lib.linux-x86_64-3.6/talib
    copying talib/test_data.py -> build/lib.linux-x86_64-3.6/talib
    copying talib/__init__.py -> build/lib.linux-x86_64-3.6/talib
    copying talib/test_pandas.py -> build/lib.linux-x86_64-3.6/talib
    copying talib/test_func.py -> build/lib.linux-x86_64-3.6/talib
    running build_ext
    building 'talib._ta_lib' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/talib
    gcc -pthread -B /home/user/miniconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/user/miniconda3/lib/python3.6/site-packages/numpy/core/include -I/usr/include -I/usr/local/include -I/opt/include -I/opt/local/include -I/home/user/miniconda3/include/python3.6m -c talib/_ta_lib.c -o build/temp.linux-x86_64-3.6/talib/_ta_lib.o
    talib/_ta_lib.c:526:10: fatal error: ta-lib/ta_defs.h: No such file or directory
     #include "ta-lib/ta_defs.h"
              ^~~~~~~~~~~~~~~~~~
    compilation terminated.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------

最后这个是红色的 命令

/home/user/miniconda3/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-install-ugk06wz4/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 /tmp/pip-record-kipfzx36/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-ugk06wz4/ta-Lib/

当我打字时 makesudo make install 我明白了: make:***没有使目标“install”的规则。停下来。在

我做错什么了? 提前谢谢,谢谢你的好意