TA-Lib / ta-lib-python

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

Installing for Python 3.11 #577

Closed codeschris closed 1 year ago

codeschris commented 1 year ago

I want to install ta-lib for python 3.11 but keep running into an error indicating the current .whl file I am using is unsupported.

TA_Lib-0.4.24-cp310-cp310-win_amd64.whl is not a supported wheel on this platform.

I tried with the python 3.10 version but the wheel doesn't support. Any leads or help would be appreciated!

mrjbq7 commented 1 year ago

I assume you got this wheel:Archived: Python Extension Packages for Windows - Christoph Gohlkelfd.uci.eduI don’t know why they don’t have python 3.11, but it works great if you install from pip with TA-Lib installed yourself. We have a pending PR to take over making the wheels ourself which would help. On Feb 2, 2023, at 4:17 AM, Chris Mwalimo @.***> wrote: I want to install ta-lib for python 3.11 but keep running into an error indicating the current .whl file I am using is unsupported. TA_Lib-0.4.24-cp310-cp310-win_amd64.whl is not a supported wheel on this platform. I tried with the python 3.10 version but the wheel doesn't support. Any leads or help would be appreciated!

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

codeschris commented 1 year ago

Thank you! I will install from pip with TA-Lib installed as you've said

Edward-Chan commented 1 year ago

I tried to install TA-Lib in python 3.11.4 using the "python -m pip install TA-Lib" and received below message.

D:\Python>python -m pip install TA-Lib Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting TA-Lib Using cached https://pypi.tuna.tsinghua.edu.cn/packages/14/6f/58c731114c36c9233f584706452f52c53d96bbb176654945157e1e52933e/TA-Lib-0.4.27.tar.gz (266 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... done Requirement already satisfied: numpy in d:\python\lib\site-packages (from TA-Lib) (1.25.2) 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 ╰─> [14 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.win-amd64-cpython-311 creating build\lib.win-amd64-cpython-311\talib copying talib\abstract.py -> build\lib.win-amd64-cpython-311\talib copying talib\deprecated.py -> build\lib.win-amd64-cpython-311\talib copying talib\stream.py -> build\lib.win-amd64-cpython-311\talib copying talib\__init__.py -> build\lib.win-amd64-cpython-311\talib running build_ext building 'talib._ta_lib' extension error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ [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
Edward-Chan commented 1 year ago

I always cannot understand how TA-Lib related to MS Visual C++? Such error message is very confusing. It seems some fundamental "reasons". TA-Lib cannot be smoothly installed into a lot of python new versions.

codeschris commented 1 year ago

I guess it's because they are using Cython for the development of the library. This means it depends on some C/C++ libraries and most of these libraries are easily accessed when a user has Visual Studio which is loaded with the libraries on installation.

mrjbq7 commented 1 year ago

You guys seriously. The log you posted has the warning:“ UserWarning: Cannot find ta-lib library, installation may fail.”Read the installation directions. On Aug 13, 2023, at 1:32 AM, Chris Mwalimo @.***> wrote: I guess it's because they are using Cython for the development of the library. This means it depends on some C/C++ libraries and most of these libraries are easily accessed when a user has Visual Studio which is loaded with the libraries on installation.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

mrjbq7 commented 1 year ago

The visual studio community edition is free and easy to install  On Aug 13, 2023, at 12:11 AM, Edward_Chan @.***> wrote: I always cannot understand. How TA-Lib related to MS Visual C++? Such error message is very confusing. It seems some fundamental "reasons". TA-Lib cannot be smoothly installed into a lot of python new version.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

Edward-Chan commented 1 year ago

Dear John,

I have three questions to report.

Question 1 I have install the VS Studio. However, I have still received the below error message.

D:\Python>python -m pip install TA-Lib Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting TA-Lib Using cached https://pypi.tuna.tsinghua.edu.cn/packages/44/74/eddbc580f1486d55a831a04c2bd7e2e774a665e404f56d8ff30655f5cca6/TA-Lib-0.4.28.tar.gz (357 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... done Requirement already satisfied: numpy in d:\python\lib\site-packages (from TA-Lib) (1.25.2) 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 ╰─> [20 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.win-amd64-cpython-311 creating build\lib.win-amd64-cpython-311\talib copying talib\abstract.py -> build\lib.win-amd64-cpython-311\talib copying talib\deprecated.py -> build\lib.win-amd64-cpython-311\talib copying talib\stream.py -> build\lib.win-amd64-cpython-311\talib copying talib\__init__.py -> build\lib.win-amd64-cpython-311\talib running build_ext building 'talib._ta_lib' extension creating build\temp.win-amd64-cpython-311 creating build\temp.win-amd64-cpython-311\Release creating build\temp.win-amd64-cpython-311\Release\talib "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -Ic:\ta-lib\c\include -IC:\Users\admin\AppData\Local\Temp\pip-build-env-ny6egbdj\normal\Lib\site-packages\numpy\core\include -ID:\Python\include -ID:\Python\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt" /Tctalib/_ta_lib.c /Fobuild\temp.win-amd64-cpython-311\Release\talib/_ta_lib.obj _ta_lib.c talib/_ta_lib.c(1080): fatal error C1083: 无法打开包括文件: “ta_libc.h”: No such file or directory error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.37.32822\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2 [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 Question 2: Under below instruction, I have successfull run the "nmake". But what is next.? Question 3. https://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib This link is not longer working. ***@***.*** From: John Benediktsson Date: 2023-08-13 22:18 To: TA-Lib/ta-lib-python CC: Edward_Chan; Comment Subject: Re: [TA-Lib/ta-lib-python] Installing for Python 3.11 (Issue #577) You guys seriously. The log you posted has the warning:“ UserWarning: Cannot find ta-lib library, installation may fail.”Read the installation directions. On Aug 13, 2023, at 1:32 AM, Chris Mwalimo ***@***.***> wrote: I guess it's because they are using Cython for the development of the library. This means it depends on some C/C++ libraries and most of these libraries are easily accessed when a user has Visual Studio which is loaded with the libraries on installation. —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***> — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: ***@***.***>
mrjbq7 commented 1 year ago

This python project is a wrapper for a C library that needs to be installed first.

See the error:

UserWarning: Cannot find ta-lib library, installation may fail.

You need to build it using nmake and the other instructions. I suggest running the "x64 Native Command Prompt for VS 2022" or similar.

Then you should be able to python3 -m pip install ta-lib and it will work.

mrjbq7 commented 1 year ago

@Edward-Chan did that work for you?

Edward-Chan commented 1 year ago

Dear John,

Many thanks. As you mentioned below, I was successfully to install TA-Lib.

On suggestion, you may consider to add "re-installing by python3 -m pip install TA-Lib" after the "Build the Library nmake" step to complete the whole installation instruction.

I love to use TA-Lib. May TA-Lib ever success.

Edward

@.***

From: John Benediktsson Date: 2023-08-21 10:26 To: TA-Lib/ta-lib-python CC: Edward_Chan; Comment Subject: Re: [TA-Lib/ta-lib-python] Installing for Python 3.11 (Issue #577) This python project is a wrapper for a C library that needs to be installed first. See the error: UserWarning: Cannot find ta-lib library, installation may fail. You need to build it using nmake and the other instructions. I suggest running the "x64 Native Command Prompt for VS 2022" or similar. Then you should be able to python3 -m pip install ta-lib and it will work. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

olliverdt21 commented 1 year ago

talib/_ta_lib.c(680): fatal error C1083: Cannot open include file: 'ta_libc.h': No such file or directory error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\bin\HostX86\x64\cl.exe' failed with exit code 2 ??? Could someone explain me how to solve this error, and why I do not run the rsi

mrjbq7 commented 1 year ago

Look at the README. Install the TA-Lib C library first. On Sep 10, 2023, at 5:31 PM, olliverdt21 @.***> wrote: talib/_ta_lib.c(680): fatal error C1083: Cannot open include file: 'ta_libc.h': No such file or directory error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\bin\HostX86\x64\cl.exe' failed with exit code 2 ??? Could someone explain me how to solve this error, and why I do not run the rsi

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

olliverdt21 commented 1 year ago

photo_2023-09-10_18-09-09 photo_2023-09-10_18-09-24 ? How can I fix this error?

olliverdt21 commented 1 year ago

talib/_ta_lib.c(680): fatal error C1083: Cannot open include file: 'ta_libc.h': No such file or directory error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\bin\HostX86\x64\cl.exe' failed with exit code 2

Hello friend! can you tell me why I get these errors, how can I correct it?

On Sun, Sep 10, 2023 at 8:38 PM John Benediktsson @.***> wrote:

Look at the README. Install the TA-Lib C library first. On Sep 10, 2023, at 5:31 PM, olliverdt21 @.***> wrote: talib/_ta_lib.c(680): fatal error C1083: Cannot open include file: 'ta_libc.h': No such file or directory error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\bin\HostX86\x64\cl.exe' failed with exit code 2 ??? Could someone explain me how to solve this error, and why I do not run the rsi

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/TA-Lib/ta-lib-python/issues/577#issuecomment-1712994059, or unsubscribe https://github.com/notifications/unsubscribe-auth/BCLGTFS22U6ISO762FPK4SLXZZMRXANCNFSM6AAAAAAUO6OSJY . You are receiving this because you commented.Message ID: @.***>

mrjbq7 commented 1 year ago

Read the README, install the dependencies On Sep 10, 2023, at 5:46 PM, olliverdt21 @.***> wrote: talib/_ta_lib.c(680): fatal error C1083: Cannot open include file:

'ta_libc.h': No such file or directory

error: command 'C:\Program Files (x86)\Microsoft Visual

Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\bin\HostX86\x64\cl.exe'

failed with exit code 2

Hello friend! can you tell me why I get these errors, how can I correct it?

On Sun, Sep 10, 2023 at 8:38 PM John Benediktsson @.***>

wrote:

Look at the README. Install the TA-Lib C library first. On Sep 10, 2023,

at 5:31 PM, olliverdt21 @.***> wrote:

talib/_ta_lib.c(680): fatal error C1083: Cannot open include file:

'ta_libc.h': No such file or directory

error: command 'C:\Program Files (x86)\Microsoft Visual

Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\bin\HostX86\x64\cl.exe'

failed with exit code 2 ??? Could someone explain me how to solve this

error, and why I do not run the rsi

—Reply to this email directly, view it on GitHub, or unsubscribe.You are

receiving this because you commented.Message ID: @.***>

Reply to this email directly, view it on GitHub

https://github.com/TA-Lib/ta-lib-python/issues/577#issuecomment-1712994059,

or unsubscribe

https://github.com/notifications/unsubscribe-auth/BCLGTFS22U6ISO762FPK4SLXZZMRXANCNFSM6AAAAAAUO6OSJY

.

You are receiving this because you commented.Message ID:

@.***>

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>