Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

pip - Python TA-Lib install problems

Frustratingly having a lot of difficult installing the TA-Lib package in python.

https://pypi.python.org/pypi/TA-Lib

I have read through all the forum posts I can find on this but no such luck for my particular problem..

Windows 10 Python 3.5.2 Anaconda 4.2.0 Cython 0.24.1 Microsoft Visual Studio 14.0

I have downloaded and extracted ?ta-lib-0.4.0-msvc.zip to C:/TA-Lib (common problems seem to be people not installing the underlying TA-Lib file http://www.ta-lib.org/hdr_dw.html)

If someone could help me solve this I would be very appreciative!

Using 'pip install ta-lib' I get the following:

C:UsersMatt>pip install ta-lib
Collecting ta-lib
  Using cached TA-Lib-0.4.10.tar.gz
Building wheels for collected packages: ta-lib
  Running setup.py bdist_wheel for ta-lib ... error
  Complete output from command c:usersmattanaconda3python.exe -u -c "import setuptools, tokenize;__file__='C:\Users\Matt\AppData\Local\Temp\pip-build-vv02ktg_\ta-lib\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('
', '
');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:UsersMattAppDataLocalTempmpqstzmsgspip-wheel- --python-tag cp35:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating buildlib.win-amd64-3.5
  creating buildlib.win-amd64-3.5alib
  copying talibdeprecated.py -> buildlib.win-amd64-3.5alib
  copying talibest_abstract.py -> buildlib.win-amd64-3.5alib
  copying talibest_data.py -> buildlib.win-amd64-3.5alib
  copying talibest_func.py -> buildlib.win-amd64-3.5alib
  copying talibest_stream.py -> buildlib.win-amd64-3.5alib
  copying talib\__init__.py -> buildlib.win-amd64-3.5alib
  running build_ext
  skipping 'talibcommon.c' Cython extension (up-to-date)
  building 'talib.common' extension
  creating buildemp.win-amd64-3.5
  creating buildemp.win-amd64-3.5Release
  creating buildemp.win-amd64-3.5Releasealib
  C:Program Files (x86)Microsoft Visual Studio 14.0VCBINx86_amd64cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:usersmattanaconda3libsite-packages
umpycoreinclude -Ic:a-libcinclude -Ic:usersmattanaconda3include -Ic:usersmattanaconda3include "-IC:Program Files (x86)Microsoft Visual Studio 14.0VCINCLUDE" "-IC:Program Files (x86)Windows Kits10include10.0.10240.0ucrt" "-IC:Program Files (x86)Windows Kits8.1includeshared" "-IC:Program Files (x86)Windows Kits8.1includeum" "-IC:Program Files (x86)Windows Kits8.1includewinrt" /Tctalibcommon.c /Fobuildemp.win-amd64-3.5Releasealibcommon.obj
  common.c
  C:Program Files (x86)Microsoft Visual Studio 14.0VCBINx86_amd64link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:c:a-libclib /LIBPATH:c:usersmattanaconda3libs /LIBPATH:c:usersmattanaconda3PCbuildamd64 "/LIBPATH:C:Program Files (x86)Microsoft Visual Studio 14.0VCLIBamd64" "/LIBPATH:C:Program Files (x86)Windows Kits10lib10.0.10240.0ucrtx64" "/LIBPATH:C:Program Files (x86)Windows Kits8.1libwinv6.3umx64" ta_libc_cdr.lib /EXPORT:PyInit_common buildemp.win-amd64-3.5Releasealibcommon.obj /OUT:buildlib.win-amd64-3.5alibcommon.cp35-win_amd64.pyd /IMPLIB:buildemp.win-amd64-3.5Releasealibcommon.cp35-win_amd64.lib
  common.obj : warning LNK4197: export 'PyInit_common' specified multiple times; using first specification
     Creating library buildemp.win-amd64-3.5Releasealibcommon.cp35-win_amd64.lib and object buildemp.win-amd64-3.5Releasealibcommon.cp35-win_amd64.exp
  common.obj : error LNK2001: unresolved external symbol TA_SetUnstablePeriod
  common.obj : error LNK2001: unresolved external symbol TA_Shutdown
  common.obj : error LNK2001: unresolved external symbol TA_Initialize
  common.obj : error LNK2001: unresolved external symbol TA_GetUnstablePeriod
  common.obj : error LNK2001: unresolved external symbol TA_GetVersionString
  buildlib.win-amd64-3.5alibcommon.cp35-win_amd64.pyd : fatal error LNK1120: 5 unresolved externals
  error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe' failed with exit status 1120

  ----------------------------------------
  Failed building wheel for ta-lib
  Running setup.py clean for ta-lib
Failed to build ta-lib
Installing collected packages: ta-lib
  Running setup.py install for ta-lib ... error
    Complete output from command c:usersmattanaconda3python.exe -u -c "import setuptools, tokenize;__file__='C:\Users\Matt\AppData\Local\Temp\pip-build-vv02ktg_\ta-lib\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('
', '
');f.close();exec(compile(code, __file__, 'exec'))" install --record C:UsersMattAppDataLocalTemppip-qxmjmn5m-recordinstall-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating buildlib.win-amd64-3.5
    creating buildlib.win-amd64-3.5alib
    copying talibdeprecated.py -> buildlib.win-amd64-3.5alib
    copying talibest_abstract.py -> buildlib.win-amd64-3.5alib
    copying talibest_data.py -> buildlib.win-amd64-3.5alib
    copying talibest_func.py -> buildlib.win-amd64-3.5alib
    copying talibest_stream.py -> buildlib.win-amd64-3.5alib
    copying talib\__init__.py -> buildlib.win-amd64-3.5alib
    running build_ext
    skipping 'talibcommon.c' Cython extension (up-to-date)
    building 'talib.common' extension
    creating buildemp.win-amd64-3.5
    creating buildemp.win-amd64-3.5Release
    creating buildemp.win-amd64-3.5Releasealib
    C:Program Files (x86)Microsoft Visual Studio 14.0VCBINx86_amd64cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:usersmattanaconda3libsite-packages
umpycoreinclude -Ic:a-libcinclude -Ic:usersmattanaconda3include -Ic:usersmattanaconda3include "-IC:Program Files (x86)Microsoft Visual Studio 14.0VCINCLUDE" "-IC:Program Files (x86)Windows Kits10include10.0.10240.0ucrt" "-IC:Program Files (x86)Windows Kits8.1includeshared" "-IC:Program Files (x86)Windows Kits8.1includeum" "-IC:Program Files (x86)Windows Kits8.1includewinrt" /Tctalibcommon.c /Fobuildemp.win-amd64-3.5Releasealibcommon.obj
    common.c
    C:Program Files (x86)Microsoft Visual Studio 14.0VCBINx86_amd64link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:c:a-libclib /LIBPATH:c:usersmattanaconda3libs /LIBPATH:c:usersmattanaconda3PCbuildamd64 "/LIBPATH:C:Program Files (x86)Microsoft Visual Studio 14.0VCLIBamd64" "/LIBPATH:C:Program Files (x86)Windows Kits10lib10.0.10240.0ucrtx64" "/LIBPATH:C:Program Files (x86)Windows Kits8.1libwinv6.3umx64" ta_libc_cdr.lib /EXPORT:PyInit_common buildemp.win-amd64-3.5Releasealibcommon.obj /OUT:buildlib.win-amd64-3.5alibcommon.cp35-win_amd64.pyd /IMPLIB:buildemp.win-amd64-3.5Releasealibcommon.cp35-win_amd64.lib
    common.obj : warning LNK4197: export 'PyInit_common' specified multiple times; using first specification
       Creating library buildemp.win-amd64-3.5Releasealibcommon.cp35-win_amd64.lib and object buildemp.win-amd64-3.5Releasealibcommon.cp35-win_amd64.exp
    common.obj : error LNK2001: unresolved external symbol TA_SetUnstablePeriod
    common.obj : error LNK2001: unresolved external symbol TA_Shutdown
    common.obj : error LNK2001: unresolved external symbol TA_Initialize
    common.obj : error LNK2001: unresolved external symbol TA_GetUnstablePeriod
    common.obj : error LNK2001: unresolved external symbol TA_GetVersionString
    buildlib.win-amd64-3.5alibcommon.cp35-win_amd64.pyd : fatal error LNK1120: 5 unresolved externals
    error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe' failed with exit status 1120

    ----------------------------------------
Command "c:usersmattanaconda3python.exe -u -c "import setuptools, tokenize;__file__='C:\Users\Matt\AppData\Local\Temp\pip-build-vv02ktg_\ta-lib\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('
', '
');f.close();exec(compile(code, __file__, 'exec'))" install --record C:UsersMattAppDataLocalTemppip-qxmjmn5m-recordinstall-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:UsersMattAppDataLocalTemppip-build-vv02ktg_a-lib
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You could try the "Unofficial Windows Binaries for Python Extension Packages by Christoph Gohlke, Laboratory for Fluorescence Dynamics, University of California, Irvine."

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

He has different versions compiled depending on OS and Python version. You probably need TA_Lib?0.4.10?cp35?cp35m?win_amd64.whl

Good luck.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...