【发布时间】:2017-04-07 05:08:00
【问题描述】:
尝试在我的 Mac 上将 Ta-lib 作为全局包安装时出现 gcc 错误。
我收到以下错误:
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I//anaconda/include -arch x86_64 -I//anaconda/include -arch x86_64 -I//anaconda/lib/python3.6/site-packages/numpy/core/include -I/usr/include -I/usr/local/include -I/opt/include -I/opt/local/include -I//anaconda/include/python3.6m -c talib/common.c -o build/temp.macosx-10.7-x86_64-3.6/talib/common.o
talib/common.c:242:10: fatal error: 'ta-lib/ta_defs.h' file not found
#include "ta-lib/ta_defs.h"
^
1 error generated.
error: command 'gcc' failed with exit status 1
我不确定我是否理解这意味着什么? pip install Ta-lib 包缺少文件?这是有道理的,但它可以很好地安装在我的 Ubuntu 服务器上,只是我的 mac 有问题。 Ubuntu 也使用相同版本的 Anaconda 运行 Python。
我的 gcc 版本如下:
➜ ~ which gcc
/usr/bin/gcc
➜ ~ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
我的Python安装信息如下:
➜ ~ which python
/anaconda/bin/python
➜ ~ python --version
Python 3.6.1 :: Anaconda custom (x86_64)
我实际上更喜欢将 Ta-lib 安装为全局 conda 包,因为我最终将它与我的大多数笔记本电脑一起使用,这些笔记本电脑都是非常临时的工作。
【问题讨论】:
-
小更新这似乎是 Python 版本问题。安装到 Python27x conda env 工作正常。该软件包应该支持 Python3...
标签: python python-3.x gcc ta-lib