问题
I am attempting to install blpapi-3.5.5 for python according to the instructions in the README, but when running
python setup.py install
I get the following error:
running install
running build
running build_py
running build_ext
building 'blpapi._internals' extension
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/erlend/blpapi_cpp_3.8.8.1/include/include -I/home/erlend/anaconda/include/python2.7 -c blpapi/internals_wrap.cxx -o build/temp.linux-x86_64-2.7/blpapi/internals_wrap.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
blpapi/internals_wrap.cxx:3110:26: fatal error: blpapi_types.h: No such file or directory
#include "blpapi_types.h"
^
compilation terminated.
error: command 'gcc' failed with exit status 1
回答1:
The BLPAPI Python SDK is a wrapper around the C/C++ SDK, and as the README file documents, you need to have that SDK available (downloaded and unpacked) and the BLPAPI_ROOT environment variable set to indicate the location of the C/C++ SDK.
The error message you've indicated shows that the header files from the C/C++ SDK could not be found, so something is not configured properly. Please ensure that you have the latest C/C++ SDK unpacked on your system, and that you've set the BLPAPI_ROOT variable to point to its location. After setting that variable, the command:
ls $BLPAPI_ROOT/include
Should result in a listing of the header files, including blpapi_types.h.
来源:https://stackoverflow.com/questions/32026901/python-blpapi-installation-error