2017-07-26 144 views
1

我試圖在Windows中安裝利布,但我發現了這個錯誤:當我運行失敗在Windows安裝利布7

common.obj : error LNK2019: unresolved external symbol TA_GetUnstablePeriod referenced in function __pyx_pf_5talib_6common_8_ta_get_unstable_period 
    build\lib.win-amd64-2.7\talib\common.pyd : fatal error LNK1120: 5 unresolved externals 
    error: command 'C:\\Users\\felipe.ferminiano\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\link.exe' failed with exit status 1120 

    ---------------------------------------- 
Command "C:\ProgramData\Anaconda2\python.exe -u -c 
    "import setuptools, tokenize; 
     __file__='c:\\users\\felipe~1.fer\\appdata\\local\\temp\\pip-build-kye3ah\\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\felipe~1.fer\appdata\local\temp\pip-al6w47-record\install-record.txt --single-version-externally-managed --compile" 
failed with error code 1 in c:\users\felipe~1.fer\appdata\local\temp\pip-build-kye3ah\TA-Lib\ 

pip install TA-Lib 

我已經安裝了Microsoft Visual C++編譯器for Python 2.7。 我該如何解決這個問題?

回答

1

該錯誤是在資源庫中的README提到:GitHub Repo

Sometimes installation will produce build errors like this:

func.c:256:28: fatal error: ta-lib/ta_libc.h: No such file or directory 
compilation terminated. 

This typically means that it can't find the underlying TA-Lib library, a dependency which needs to be installed. On Windows, this could be caused by installing the 32-bit binary distribution of the underlying TA-Lib library, but trying to use it with 64-bit Python.

由於您的錯誤日誌包含amd64它很可能是使用了32位VS 64位的問題是你的實際問題。

圖書館僅分佈在32位格式(編譯/鏈接日期是從2007年)

檢查問題#11,GitHub - Issue #11關於如何自己編譯的提示。