TA-Lib / ta-lib-python

Python wrapper for TA-Lib (http://ta-lib.org/).
http://ta-lib.github.io/ta-lib-python
Other
9.49k stars 1.74k forks source link

Cannot install on Windows 7 Pro. #459

Closed reuniware closed 3 years ago

reuniware commented 3 years ago

Hello. I'm trying to install TA-Lib with pip but I have the following errors :+1:

D:\freqtrade-stable>pip install TA-Lib
Collecting TA-Lib
  Downloading https://files.pythonhosted.org/packages/40/36/ea7b36b5d46b489d3b7aba4281cb430279ef1980974ea513164e85261547/TA-Lib-0.4.21.tar.g
z (270kB)
    100% |████████████████████████████████| 276kB 2.5MB/s
Collecting numpy (from TA-Lib)
  Downloading https://files.pythonhosted.org/packages/3b/d7/3e9f4291aaac0ccd61cd0b3ccfb3a192f3f2d6be8c86a02d0b93811ff1ee/numpy-1.21.2-cp37-c
p37m-win_amd64.whl (14.0MB)
    100% |████████████████████████████████| 14.0MB 1.0MB/s
Installing collected packages: numpy, TA-Lib
  Running setup.py install for TA-Lib ... error
    Complete output from command d:\python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\UTILIS~1\\AppData\\Local\\Te
mp\\pip-install-neu9lesn\\TA-Lib\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(c
ompile(code, __file__, 'exec'))" install --record C:\Users\UTILIS~1\AppData\Local\Temp\pip-record-h0ybgang\install-record.txt --single-versi
on-externally-managed --compile:
    C:\Users\UTILIS~1\AppData\Local\Temp\pip-install-neu9lesn\TA-Lib\setup.py:76: 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.win-amd64-3.7
    creating build\lib.win-amd64-3.7\talib
    copying talib\abstract.py -> build\lib.win-amd64-3.7\talib
    copying talib\deprecated.py -> build\lib.win-amd64-3.7\talib
    copying talib\stream.py -> build\lib.win-amd64-3.7\talib
    copying talib\test_abstract.py -> build\lib.win-amd64-3.7\talib
    copying talib\test_data.py -> build\lib.win-amd64-3.7\talib
    copying talib\test_func.py -> build\lib.win-amd64-3.7\talib
    copying talib\test_pandas.py -> build\lib.win-amd64-3.7\talib
    copying talib\test_stream.py -> build\lib.win-amd64-3.7\talib
    copying talib\__init__.py -> build\lib.win-amd64-3.7\talib
    running build_ext
    building 'talib._ta_lib' extension
    creating build\temp.win-amd64-3.7
    creating build\temp.win-amd64-3.7\Release
    creating build\temp.win-amd64-3.7\Release\talib
    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /D
NDEBUG /MT -Ic:\ta-lib\c\include -Id:\python37\lib\site-packages\numpy\core\include -Id:\python37\include -Id:\python37\include "-IC:\Progra
m Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\
include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.1836
2.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.
0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /Tctalib/_ta_lib.c /Fobuild\temp.win-amd64-3.7\Release\tal
ib/_ta_lib.obj
    _ta_lib.c
    talib/_ta_lib.c(611): fatal error C1083: Impossible d'ouvrir le fichier includeÿ: 'ta_libc.h'ÿ: No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX86\\x64\\cl.e
xe' failed with exit status 2

    ----------------------------------------
Command "d:\python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\UTILIS~1\\AppData\\Local\\Temp\\pip-install-neu9lesn
\\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 C:\Users\UTILIS~1\AppData\Local\Temp\pip-record-h0ybgang\install-record.txt --single-version-externally-managed --
compile" failed with error code 1 in C:\Users\UTILIS~1\AppData\Local\Temp\pip-install-neu9lesn\TA-Lib\
You are using pip version 18.1, however version 21.2.4 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

D:\freqtrade-stable>
mrjbq7 commented 3 years ago
      warnings.warn('Cannot find ta-lib library, installation may fail.')
mrjbq7 commented 3 years ago

Did you install the TA-Lib underlying C library?

mrjbq7 commented 3 years ago

See the README for installation details on Windows.

reuniware commented 3 years ago

Ok I'm going to read the README.

mrjbq7 commented 3 years ago

Many windows users find it easier to install one of the unofficial wheels...

reuniware commented 3 years ago

I can't find the README for Windows.

mrjbq7 commented 3 years ago

https://github.com/mrjbq7/ta-lib#windows

reuniware commented 3 years ago

So I need to build it ?

mrjbq7 commented 3 years ago

You might also try these unofficial windows binaries for both 32-bit and 64-bit:

https://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib

reuniware commented 3 years ago

How to use these whl files ?

mrjbq7 commented 3 years ago

download it then pip install TA_Lib‑0.4.21‑cp310‑cp310‑win_amd64.whl.

mrjbq7 commented 3 years ago

(or appropriate one for your platform)

mrjbq7 commented 3 years ago

cp310 is python 3.10, cp38 is python 3.8, etc.

win_amd64 is 64-bit, win32 is 32-bit

etc

reuniware commented 3 years ago

Ok thank you, I'm gonna try now.

mrjbq7 commented 3 years ago

Great! Let me know if you have further issues installing!

reuniware commented 3 years ago

It seems ok now, thanks a lot !

D:\freqtrade-stable>pip install TA_Lib-0.4.21-cp37-cp37m-win_amd64.whl
Processing d:\freqtrade-stable\ta_lib-0.4.21-cp37-cp37m-win_amd64.whl
Installing collected packages: TA-Lib
Successfully installed TA-Lib-0.4.21