TA-Lib / ta-lib-python

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

Issue installing TA-Lib on windows #643

Closed TwoPrismsOneGround closed 1 month ago

TwoPrismsOneGround commented 3 months ago

At first I got an error telling me to upgrade my C++ build tools which I did. Now my error appears to be that it fails to build the wheel during installation:

https://paste.pythondiscord.com/N7SQ

mrjbq7 commented 3 months ago

Do you have the TA-Lib C library installed first?On Mar 29, 2024, at 9:19 AM, TwoPrismsOneGround @.***> wrote: At first I got an error telling me to upgrade my C++ build tools which I did. Now my error appears to be that it fails to build the wheel during installation: https://paste.pythondiscord.com/N7SQ

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

TwoPrismsOneGround commented 3 months ago

Collaborator

I did not do that, would that be "pip install TA-Lib C". I tried that command and got some things installed then got another error:

`pip install TA-Lib C Collecting TA-Lib Using cached 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 Collecting C Downloading c-0.1.0-py3-none-any.whl.metadata (3.7 kB) Requirement already satisfied: numpy in c:\users\alcor\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from TA-Lib) (1.26.4) Collecting arrow==0.12.1 (from C) Downloading arrow-0.12.1.tar.gz (65 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 65.4/65.4 kB 3.4 MB/s eta 0:00:00 Preparing metadata (setup.py) ... done Collecting click==6.7 (from C) Downloading click-6.7-py2.py3-none-any.whl.metadata (424 bytes) Collecting ipython==7.2.0 (from C) Downloading ipython-7.2.0-py3-none-any.whl.metadata (4.5 kB) Collecting matplotlib==2.2.0 (from C) Downloading matplotlib-2.2.0.tar.gz (37.2 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 37.2/37.2 MB 81.8 MB/s eta 0:00:00 Preparing metadata (setup.py) ... error error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [61 lines of output]

  Edit setup.cfg to change the build options

  BUILDING MATPLOTLIB
              matplotlib: yes [2.2.0]
                  python: yes [3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023,
                          00:38:17) [MSC v.1929 64 bit (AMD64)]]
                platform: yes [win32]

  REQUIRED DEPENDENCIES AND EXTENSIONS
                   numpy: yes [version 1.26.4]
        install_requires: yes [handled by setuptools]
                  libagg: yes [pkg-config information for 'libagg' could not
                          be found. Using local copy.]
                freetype: no  [The C/C++ header for freetype
                          (freetype2\ft2build.h) could not be found.  You may
                          need to install the development package.]
                     png: no  [The C/C++ header for png (png.h) could not be
                          found.  You may need to install the development
                          package.]
                   qhull: yes [pkg-config information for 'libqhull' could not
                          be found. Using local copy.]

  OPTIONAL SUBPACKAGES
             sample_data: yes [installing]
                toolkits: yes [installing]
                   tests: no  [skipping due to configuration]
          toolkits_tests: no  [skipping due to configuration]

  OPTIONAL BACKEND EXTENSIONS
                  macosx: no  [Mac OS-X only]
                  qt5agg: no  [PySide2 not found; PyQt5 not found]
                  qt4agg: no  [PySide not found; PyQt4 not found]
                 gtk3agg: no  [Requires pygobject to be installed.]
               gtk3cairo: no  [Requires cairocffi or pycairo to be installed.]
                  gtkagg: no  [Requires pygtk]
                   tkagg: yes [installing; run-time loading from Python Tcl /
                          Tk]
                   wxagg: no  [requires wxPython]
                     gtk: no  [Requires pygtk]
                     agg: yes [installing]
                   cairo: no  [cairocffi or pycairo not found]
               windowing: yes [installing]

  OPTIONAL LATEX DEPENDENCIES
                  dvipng: no
             ghostscript: no
                   latex: no
                 pdftops: no

  OPTIONAL PACKAGE DATA
                    dlls: no  [skipping due to configuration]

  ============================================================================
                          * The following required packages can not be built:
                          * freetype, png
                          * Please check http://gnuwin32.sourceforge.net/packa
                          * ges/freetype.htm for instructions to install
                          * freetype
                          * Please check http://gnuwin32.sourceforge.net/packa
                          * ges/libpng.htm for instructions to install png
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed

× Encountered error while generating package metadata. ╰─> See above for output.

note: This is an issue with the package mentioned above, not pip. hint: See above for details.`

mrjbq7 commented 3 months ago

Look at the README for platform instructions:

https://github.com/ta-lib/ta-lib-python?tab=readme-ov-file#dependencies

On Fri, Mar 29, 2024 at 10:22 AM John Benediktsson @.***> wrote:

Do you have the TA-Lib C library installed first?

On Mar 29, 2024, at 9:19 AM, TwoPrismsOneGround @.***> wrote:



At first I got an error telling me to upgrade my C++ build tools which I did. Now my error appears to be that it fails to build the wheel during installation:

https://paste.pythondiscord.com/N7SQ

— Reply to this email directly, view it on GitHub https://github.com/TA-Lib/ta-lib-python/issues/643, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAF5A3JOUGCUV743VL4TN3Y2WIABAVCNFSM6AAAAABFOUA3F6VHI2DSMVQWIX3LMV43ASLTON2WKOZSGIYTKNRUGQ3TCOA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

TwoPrismsOneGround commented 3 months ago

Look at the README for platform instructions: https://github.com/ta-lib/ta-lib-python?tab=readme-ov-file#dependencies

I have followed those instructions to manually create a 64 bit version. on windows However when I run "nmake" I get countless lines of this:

_regtest\ta_test_func\test_per_ohlc.c test_per_ohlc.c cl -c -nologo -W3 -MD -O2 -DWIN32 -D_MBCS -D_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\..\src\ta_common" -I"..\..\..\..\..\src\tools\ta_regtest" -I"..\..\..\..\..\src\ta_func" -I"..\..\..\..\..\include" -Fo..\..\..\..\..\temp\cdr\test_po.obj ..\..\..\..\..\src\tools\ta_regtest\ta_test_func\test_po.c test_po.c cl -c -nologo -W3 -MD -O2 -DWIN32 -D_MBCS -D_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\..\src\ta_common" -I"..\..\..\..\..\src\tools\ta_regtest" -I"..\..\..\..\..\src\ta_func" -I"..\..\..\..\..\include" -Fo..\..\..\..\..\temp\cdr\test_rsi.obj ..\..\..\..\..\src\tools\ta_regtest\ta_test_func\test_rsi.c test_rsi.c cl -c -nologo -W3 -MD -O2 -DWIN32 -D_MBCS -D_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\..\src\ta_common" -I"..\..\..\..\..\src\tools\ta_regtest" -I"..\..\..\..\..\src\ta_func" -I"..\..\..\..\..\include" -Fo..\..\..\..\..\temp\cdr\test_sar.obj ..\..\..\..\..\src\tools\ta_regtest\ta_test_func\test_sar.c test_sar.c cl -c -nologo -W3 -MD -O2 -DWIN32 -D_MBCS -D_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\..\src\ta_common" -I"..\..\..\..\..\src\tools\ta_regtest" -I"..\..\..\..\..\src\ta_func" -I"..\..\..\..\..\include" -Fo..\..\..\..\..\temp\cdr\test_stddev.obj ..\..\..\..\..\src\tools\ta_regtest\ta_test_func\test_stddev.c test_stddev.c cl -c -nologo -W3 -MD -O2 -DWIN32 -D_MBCS -D_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\..\src\ta_common" -I"..\..\..\..\..\src\tools\ta_regtest" -I"..\..\..\..\..\src\ta_func" -I"..\..\..\..\..\include" -Fo..\..\..\..\..\temp\cdr\test_stoch.obj ..\..\..\..\..\src\tools\ta_regtest\ta_test_func\test_stoch.c test_stoch.c cl -c -nologo -W3 -MD -O2 -DWIN32 -D_MBCS -D_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\..\src\ta_common" -I"..\..\..\..\..\src\tools\ta_regtest" -I"..\..\..\..\..\src\ta_func" -I"..\..\..\..\..\include" -Fo..\..\..\..\..\temp\cdr\test_trange.obj ..\..\..\..\..\src\tools\ta_regtest\ta_test_func\test_trange.c test_trange.c cl -c -nologo -W3 -MD -O2 -DWIN32 -D_MBCS -D_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\..\src\ta_common" -I"..\..\..\..\..\src\tools\ta_regtest" -I"..\..\..\..\..\src\ta_func" -I"..\..\..\..\..\include" -Fo..\..\..\..\..\temp\cdr\test_util.obj ..\..\..\..\..\src\tools\ta_regtest\test_util.c test_util.c cl -c -nologo -W3 -MD -O2 -DWIN32 -D_MBCS -D_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\..\src\ta_common" -I"..\..\..\..\..\src\tools\ta_regtest" -I"..\..\..\..\..\src\ta_func" -I"..\..\..\..\..\include" -Fo..\..\..\..\..\temp\cdr\test_data.obj ..\..\..\..\..\src\tools\ta_regtest\test_data.c test_data.c cl -c -nologo -W3 -MD -O2 -DWIN32 -D_MBCS -D_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\..\src\ta_common" -I"..\..\..\..\..\src\tools\ta_regtest" -I"..\..\..\..\..\src\ta_func" -I"..\..\..\..\..\include" -Fo..\..\..\..\..\temp\cdr\test_abstract.obj ..\..\..\..\..\src\tools\ta_regtest\test_abstract.c test_abstract.c

Afterwards it still shows TA-Lib as not being installed when I check in vscode terminal.

EDIT: I was able to install an unsupported build here:

https://github.com/cgohlke/talib-build/

italo013 commented 3 months ago

I'm with the same problem, install TA-Lib on windows. I have been follow these steps but return an error. Anyone know how to fix it?

image

mrjbq7 commented 3 months ago

That error maybe implies you aren’t running from a developer command prompt ?On Apr 1, 2024, at 6:42 PM, Italo Igor @.***> wrote: I'm with the same problem, install TA-Lib on windows. I have been follow these steps but return an error. Anyone know how to fix it? image.png (view on web)

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

italo013 commented 3 months ago

I'm using the same terminal of the video

image

mrjbq7 commented 3 months ago

I don’t know what video but see this stack overflow  https://stackoverflow.com/a/8323450On Apr 1, 2024, at 6:58 PM, Italo Igor @.***> wrote: I'm using the same terminal of the video image.png (view on web)

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

italo013 commented 3 months ago

page not found

image

mrjbq7 commented 3 months ago

Here’s the text -If you compile from the command-line, you should use the Visual Studio Command Prompt as it sets common environment variables that are used for compiling.If for some reason you insist on using cmd.exe then you have to either add the include paths to the INCLUDEenvironment variable or you have to give the compiler the command-line parameter /IC:\Path\to\includeDetails are available on MSDNedit: well since this got recently upvoted I might as well add what I forgot last time. If you want to set up the environment variables that the Visual Studio Command Prompt uses you can just execute the vcvarsall.bat which is located in a directory like C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC for details consult the relevant MSDN pageOn Apr 1, 2024, at 7:04 PM, Italo Igor @.***> wrote: page not found image.png (view on web)

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