如何在Mac OS X上安装用于Python2.7的Bloomberg API库

2024-05-23 21:44:27 发布

您现在位置:Python中文网/ 问答频道 /正文

我正试图将我的Mac OS X系统设置为使用pdblpPython库,该库要求我首先安装Bloomberg Open API libary for Python。在克隆git repo并运行python setup.py install之后,我得到

File "setup.py", line 20, in <module>
  raise Exception("BLPAPI_ROOT environment variable isn't defined")
Exception: BLPAPI_ROOT environment variable isn't defined

我该怎么做?


Tags: pyenvironmentosmac系统setupexceptionroot
2条回答

您还需要安装C/C++ libraries,然后将BLPAPI根设置为libblpapi3_32.solibblpapi3_64.so文件的位置。例如:

cd /some/directory
wget https://bloomberg.bintray.com/BLPAPI-Experimental-Generic/blpapi_cpp_3.8.1.1-darwin.tar.gz
tar zxvf blpapi_cpp_3.8.1.1-darwin.tar.gz

export BLPAPI_ROOT=/some/directory/blpapi_cpp_3.8.1.1/Darwin

export BLPAPI_ROOT=/some/directory/blpapi_cpp_3.8.1.1

然后可以继续安装python库。

只是为了完成这个问题(谢谢大家:)

包源-https://www.bloomberglabs.com/api/libraries/

准备

    < C/C++ +的SDK
  1. 用于Python的SDK

说明

# navigate yourself to the path where you want to keep your SDK for some tim
cd /Users/msam/

# unzip C/C++ Package
tar zxvf Downloads/blpapi_cpp_3.8.1.1-darwin.tar.gz

# set variable
export BLPAPI_ROOT=/some/directory/blpapi_cpp_3.8.1.1/
export DYLD_LIBRARY_PATH=/Users/sampathkumarm/blpapi_cpp_3.8.1.1/Darwin/

# save variable to reuse in next session
echo >> ~/.bash_profile
echo "Bloomberg API (python)library Settings " >> ~/.bash_profile
echo "export BLPAPI_ROOT=/some/directory/blpapi_cpp_3.8.1.1/" >> ~/.bash_profile
echo "export DYLD_LIBRARY_PATH=/Users/sampathkumarm/blpapi_cpp_3.8.1.1/Darwin/"  >> ~/.bash_profile
echo >> ~/.bash_profile

参考号: 一。python blpapi installation error

相关问题 更多 >