Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation On Windows 8 64-Bit? #11

Closed
pcawthron opened this issue Nov 20, 2012 · 10 comments
Closed

Installation On Windows 8 64-Bit? #11

pcawthron opened this issue Nov 20, 2012 · 10 comments

Comments

@pcawthron
Copy link

I've been looking at installing ta-lib on Windows 8 64-bit but I am not confident. Here are my actions after deleting any previous python versions:

  • Install VS2010 Ultimate
  • Download ta-lib-0.4.0-msvc.zip and extract to c:\ta-lib
  • Open C:\ta-lib\c\ide\vs2005\lib_proj\ta_lib.sln and compile 6 builds to 64-bit without errors
  • Because I wanted my binaries to be used I deleted everything apart from:
    (As downloaded)
    C:\ta-lib\c\include\ta_abstract
    C:\ta-lib\c\include\ta_common
    C:\ta-lib\c\include\ta_defs
    C:\ta-lib\c\include\ta_func
    C:\ta-lib\c\include\libc
    (Produced by VS2010)
    C:\ta-lib\c\bin\ta_regtest
    C:\ta-lib\c\bin\ta_regtest_cdr
    C:\ta-lib\c\bin\gen_code
    C:\ta-lib\c\bin\gen_code_cdr
    C:\ta-lib\c\lib\ta_func_cdr
    C:\ta-lib\c\lib\ta_libc_cdr
    C:\ta-lib\c\lib\ta_abstract_cdr
    C:\ta-lib\c\lib\ta_common_cdr
  • Following advice from here I amended setup.py to:
    if sys.platform in ("linux2", "darwin"):
    include_talib_dir = "/usr/local/include/"
    lib_talib_dir = "/usr/local/lib/"
    elif sys.platform == "win32":
    include_talib_dir = r"c:\ta-lib\c\include"
    lib_talib_dir = r"c:\ta-lib\c\lib"
  • Also from advice here I amended talib.c to:
    #if defined(WIN32) || defined(MS_WINDOWS)
    #define _USE_MATH_DEFINES
    #define isnan(x) _isnan(x) /* Added PC 2012-11-20 _/ << added - is this needed in VS2010?
    #endif
    #include <math.h>
    #define __PYX_HAVE__talib
    #define __PYX_HAVE_API__talib
    #include "stdio.h"
    #include "stdlib.h"
    #include "numpy/arrayobject.h"
    #include "numpy/ufuncobject.h"
    #include "math.h"
    #include "ta_libc.h" << amended
    #ifdef OPENMP
    #include <omp.h>
    #endif /
    _OPENMP */
  • I then installed python 2.7 64-bit and sys.maxsize confirms as 2^63-1
  • I installed 64-bit binaries of numpy and Cython from http://www.lfd.uci.edu/~gohlke/pythonlibs/
  • I found I had to use SET VS90COMNTOOLS=%VS100COMNTOOLS%

Now the problem. When I run 'python setup.py install' I get hundreds of warnings and errors like:

talib.c(2392) : warning C4133: '=' : incompatible types - from 'PyArrayObject *' to 'PyObject *'
.
.
talib.obj : error LNK2019: unresolved external symbol TA_GetVersionString referenced in function inittalib
build\lib.win-amd64-2.7\talib.pyd : fatal error LNK1120: 319 unresolved externals

The second time I run it I get 'skipping talib.c Cython extension (up-to-date)'. So my binaries are rubbish, right? But talib.pyd has been created.

In python I can 'import talib' and do the simple test:

data = numpy.random.random(100)
output = talib.SMA(data)

So have I got a 64-bit install? Or have I somehow got a 32-bit version by accident?

I suspect I am fooling myself. As a more complete test I installed PyAlgoTrade (see http://gbeced.github.com/pyalgotrade) which uses ta-lib and successfully ran the 204 tests in the test suite.

Regards,

Peter

@mrjbq7
Copy link
Member

mrjbq7 commented Nov 20, 2012

The link errors seem like they would be real errors, and I would have thought would prevent the C module from being used properly...

But if you can use talib.SMA and the pyalgotrade tests then it would seem to be working...?

@pcawthron
Copy link
Author

I've just installed 64-bit IPython and I'm playing in there. I get:

In [12]: talib.version
Out[12]: '0.4.0 (Nov 20 2012 17:51:48)'

which was when I ran 'python setup.py install'

In[13]: sys.maxsize
Out[13]: 9223372036854775807L

Is there anything else I can check?

Regards,

Peter

@mrjbq7 mrjbq7 mentioned this issue Feb 1, 2013
@mrjbq7
Copy link
Member

mrjbq7 commented Feb 1, 2013

I made some changes to fix the problem using isnan, are there other changes I can make to help Windows installations be easier?

@slot-29
Copy link

slot-29 commented Aug 28, 2019

Hi, I'm trying to install talib in python 3 for windows 10 64bits, I really don't understand how to do ... how could I compile?

@mrjbq7
Copy link
Member

mrjbq7 commented Aug 28, 2019 via email

@slot-29
Copy link

slot-29 commented Aug 28, 2019

¿Seguir las instrucciones en el archivo Léame? https://github.com/mrjbq7/ta-lib/blob/master/README.md#windows
...
El 27 de agosto de 2019, a las 8:11 p.m., slot-29 @.***> escribió: Hola, estoy tratando de instalar talib en Python 3 para Windows 10 64 bits, realmente no ' No entiendo cómo hacerlo ... ¿cómo podría compilar? - Estás recibiendo esto porque comentaste. Responda a este correo electrónico directamente, visualícelo en GitHub o silencie el hilo.

yes, but so far it has been impossible to install ta-lib and I really need the library

@slot-29
Copy link

slot-29 commented Aug 28, 2019

¿Seguir las instrucciones en el archivo Léame? https://github.com/mrjbq7/ta-lib/blob/master/README.md#windows
...
El 27 de agosto de 2019, a las 8:11 pm, slot-29 @ . ***> escribió : Hola, estoy tratando de instalar talib en Python 3 para Windows 10 64 bits, realmente no 'No entiendo cómo hacerlo ... ¿cómo podría compilar? - Estás recibiendo esto porque comentaste. Responda a este correo electrónico directamente, visualícelo en GitHub o silencie el hilo.

sí, pero hasta ahora ha sido imposible instalar ta-lib y realmente necesito la biblioteca

import talib as ta
ModuleNotFoundError: No module named 'talib'

@mrjbq7
Copy link
Member

mrjbq7 commented Aug 28, 2019 via email

@slot-29
Copy link

slot-29 commented Aug 28, 2019

I already did all this:

Download and Unzip ta-lib-0.4.0-msvc.zip
Move the Unzipped Folder ta-lib to C:
Download and Install Visual Studio Community 2015
Remember to Select [Visual C++] Feature
Build TA-Lib Library
From Windows Start Menu, Start [VS2015 x64 Native Tools Command Prompt]
Move to C:\ta-lib\c\make\cdr\win32\msvc
Build the Library nmake

but in this case:
"Build the Library nmake"
the only thing I did was write on nmake console .. is something else missing?

@pcawthron
Copy link
Author

There is a pre-compiled 64-bit version of the TA-Lib C library at https://github.com/afnhsn/TA-Lib_x64 which I installed today on Windows 10 with Python 2.7.16 and it works without issue. I simply deleted my old C:\talib and unzipped the 64-bit to a folder with the same name.

[I know I'm replying after several weeks but this may help others later.]

Regards,

Peter

@mrjbq7 mrjbq7 closed this as completed May 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants