问题
python3.6中调用c++库:
- 错误提示:
ImportError: libboost_python3-py36.so.1.65.1: cannot open shared object file: No such file or directory
解决
wget -O boost_1_55_0.tar.gz http://sourceforge.net/projects/boost/files/boost/1.65.1/boost_1_65_1.tar.gz/download
tar xzvf boost_1_65_1.tar.gz
cd boost_1_65_1
sh ./bootstrap.sh --with-libraries=python --with-toolset=gcc --prefix=.(安装在当前目录,默认安装位置是/usr/local)
./b2 --with-python include="/usr/local/anaconda3/include/python3.7m/"
./b2 install
#添加路劲
export LD_LIBRARY_PATH=~/software/boost_1_65_1/lib:$LD_LIBRARY_PATH