TA-Lib (mrjbq7.github.io)
TA-Lib (mrjbq7.github.io) 看这个
$ python3 -m pip install TA-Lib
Or checkout the sources and run setup.py
yourself:
$ python setup.py install
It also appears possible to install via Conda Forge:
$ conda install -c conda-forge ta-lib
You can install from PyPI:
$ pip install TA-Lib
Or checkout the sources and run setup.py
yourself:
$ python setup.py install
func.c:256:28: fatal error: ta-lib/ta_libc.h: No such file or directory
compilation terminated.
If you get build errors like this, it typically means that it can't find the underlying TA-Lib
library and needs to be installed:
To use TA-Lib for python, you need to have the TA-Lib already installed:
Mac OS X
$ brew install ta-lib
Windows
Download ta-lib-0.4.0-msvc.zip and unzip to C:\ta-lib
Linux
Download ta-lib-0.4.0-src.tar.gz and:
$ untar and cd
$ ./configure --prefix=/usr
$ make
$ sudo make install
If you build
TA-Lib
usingmake -jX
it will fail but that's OK! Simply rerunmake -jX
followed by[sudo] make install
.
Documentation Index
#################################再次报错
(rna) ubuntu@DESKTOP-O25BSJM:/mnt/g/silicosis/sicosis/gitto/python_study/scanpy_study$ pip install TA-Lib -i https://pypi.douban.com/simple/
Looking in indexes: https://pypi.douban.com/simple/
Collecting TA-Lib
Downloading https://pypi.doubanio.com/packages/7c/56/d1360aabbf9366afdb55b5b3188314c7726adcdc3f417e62e3353801663a/TA-Lib-0.4.25.tar.gz (271 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 272.0/272.0 kB 1.2 MB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy in /home/ubuntu/anaconda3/envs/rna/lib/python3.10/site-packages (from TA-Lib) (1.23.5)
Building wheels for collected packages: TA-Lib
Building wheel for TA-Lib (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for TA-Lib (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [23 lines of output]
:77: UserWarning: Cannot find ta-lib library, installation may fail.
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-310
creating build/lib.linux-x86_64-cpython-310/talib
copying talib/abstract.py -> build/lib.linux-x86_64-cpython-310/talib
copying talib/deprecated.py -> build/lib.linux-x86_64-cpython-310/talib
copying talib/stream.py -> build/lib.linux-x86_64-cpython-310/talib
copying talib/test_abstract.py -> build/lib.linux-x86_64-cpython-310/talib
copying talib/test_data.py -> build/lib.linux-x86_64-cpython-310/talib
copying talib/test_func.py -> build/lib.linux-x86_64-cpython-310/talib
copying talib/test_pandas.py -> build/lib.linux-x86_64-cpython-310/talib
copying talib/test_polars.py -> build/lib.linux-x86_64-cpython-310/talib
copying talib/test_stream.py -> build/lib.linux-x86_64-cpython-310/talib
copying talib/__init__.py -> build/lib.linux-x86_64-cpython-310/talib
running build_ext
building 'talib._ta_lib' extension
creating build/temp.linux-x86_64-cpython-310
creating build/temp.linux-x86_64-cpython-310/talib
gcc -pthread -B /home/ubuntu/anaconda3/envs/rna/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/ubuntu/anaconda3/envs/rna/include -fPIC -O2 -isystem /home/ubuntu/anaconda3/envs/rna/include -fPIC -I/usr/include -I/usr/local/include -I/opt/include -I/opt/local/include -I/opt/homebrew/include -I/opt/homebrew/opt/ta-lib/include -I/tmp/pip-build-env-e5jlx9ja/normal/lib/python3.10/site-packages/numpy/core/include -I/home/ubuntu/anaconda3/envs/rna/include/python3.10 -c talib/_ta_lib.c -o build/temp.linux-x86_64-cpython-310/talib/_ta_lib.o
error: command 'gcc' failed: No such file or directory
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for TA-Lib
Failed to build TA-Lib
ERROR: Could not build wheels for TA-Lib, which is required to install pyproject.toml-based projects
(rna) ubuntu@DESKTOP-O25BSJM:/mnt/g/silicosis/sicosis/gitto/python_study/scanpy_study$
同样的错误: 但是不能解决问题 Failed to build ta-lib ERROR: Could not build wheels for ta-lib, which is required to install pyproject.toml-based project · Issue #566 · mrjbq7/ta-lib (github.com)
mrjbq7/ta-lib: Python wrapper for TA-Lib (http://ta-lib.org/). (github.com) 试了一下官网教程
Linux
$ tar -xzf ta-lib-0.4.0-src.tar.gz
$ cd ta-lib/
$ ./configure --prefix=/usr
$ make
$ sudo make install
又出现问题
sudo apt-get -y install gcc build-essential
you need to install the c library first.
ta-lib consists of 2 parts, the C part, and the python part.
Installing the python part without the C part will fail.
The ta lib python docs have a decent instruction - alternatively you can use the quick install script (./setup.sh -i
) to install the c part (this will take a while on a raspberry).
You can also use the docker image we provide to get started with freqtrade.
但是又失败了
先安装 gcc 再来安装talib
sudo apt-get -y install gcc build-essential
apt - Failed to fetch - Installation errors - Ask Ubuntu
apt - How do I fix the GPG error "NO_PUBKEY"? - Ask Ubuntu
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32
sudo apt-get -y install gcc build-essential
$ tar -xzf ta-lib-0.4.0-src.tar.gz
$ cd ta-lib/
$ ./configure --prefix=/usr
$ make
$ sudo make install
Installation of Ta-Lib in Python: A Complete Guide for all Platforms (quantinsti.com)
pip install ta-lib
Execute the following commands in terminal
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys
where
is your missing public key for repository, e.g. 8BAF9A6F
.
Then update
sudo apt-get update
ALTERNATE METHOD:
sudo gpg --keyserver pgpkeys.mit.edu --recv-key
sudo gpg -a --export | sudo apt-key add -
sudo apt-get update
Note that when you import a key like this using apt-key
you are telling the system that you trust the key you're importing to sign software your system will be using. Do not do this unless you're sure the key is really the key of the package distributor.
或者 TA-Lib (mrjbq7.github.io)
Linux
Download ta-lib-0.4.0-src.tar.gz and:
$ untar and cd
$ ./configure --prefix=/usr
$ make
$ sudo make install