本文介绍了TA-Lib安装错误:必须使用启用了unicode的python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试使用Python和Cython的包装程序为Linux安装ta-lib(一种最初用C编码的技术分析库)时,收到一条错误消息,提示必须使用启用了unicode的python".我已经尝试谷歌搜索无济于事.

when I try to install ta-lib(a technical analysis library coded originally in C) for Python using a wrapper for Python and Cython, I get an error message saying "Must use python with unicode enabled". I have already tried googling to no avail.

这是完整的错误消息:

    C:\Python27\Lib\site-packages\ta-lib-master>python setup.py install
    running install
    running build
    running build_ext
    skipping 'talib.c' Cython extension (up-to-date)
    building 'talib' extension
    C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox
    /MD /W3 /GS- /DNDEBUG -IC:\Python27\lib\site-packages\numpy\core\include -Ic:\ms
    ys\1.0\local\include -IC:\Python27\include -IC:\Python27\PC /Tctalib.c /Fobuild\
    temp.win32-2.7\Release\talib.obj
    talib.c
    c:\python27\lib\site-packages\numpy\core\include\numpy\npy_common.h(85) : fatal
    error C1189: #error :  Must use Python with unicode enabled.
    error: command '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.ex
    e"' failed with exit status 2

推荐答案

我不确定您对代码有多少控制权-但尝试使用numpy/ndarrayobject.h构建我自己的代码,解决方案是在包含ndarrayobject标头之前,先#include"Python.h".

I'm not sure how much control you have over the code -- but trying to build my own code using numpy/ndarrayobject.h, the solution was to #include "Python.h" before including the ndarrayobject header.

这篇关于TA-Lib安装错误:必须使用启用了unicode的python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-29 18:28