python - ubuntu 16.04 中缺少 boost_python3

标签 python git ubuntu numpy boost

我正在尝试在 Ubuntu 16.04 中安装 boost.numpy。我尝试了这些命令来安装 boost.numpy

**git clone https://github.com/ndarray/Boost.NumPy.git
 cd Boost.NumPy && mkdir build && cd build
 cmake -DPYTHON_LIBRARY=$HOME/anaconda3/lib/libpython3.5m.so ../**

在执行 cmake 后我遇到了这个错误:

检测到架构“x86_64”

-- Using Python3

    CMake Error at /usr/share/cmake-3.5/Modules/FindBoost.cmake:1677 (message):
      Unable to find the requested Boost libraries.

  Boost version: 1.59.0
  Boost include path: /home/sumit/Documents/Software/boost_1_59_0
  Could not find the following static Boost libraries:

          boost_python3

  No Boost libraries were found.  You may need to set BOOST_LIBRARYDIR to the
  directory containing Boost libraries or BOOST_ROOT to the location of
  Boost.
Call Stack (most recent call first):
  CMakeLists.txt:48 (find_package)


 Boost Paths:
Include  : /home/sumit/Documents/Software/boost_1_59_0
 **Libraries**: /home/sumit/Documents/Software/boost_1_59_0/libs
Configuring incomplete, errors occurred!

另请参阅“/home/sumit/Documents/Software/Boost.NumPy/build/CMakeFiles/CMakeOutput.log”。

以前无法找到 boost 库 sp 我手动将 CmakeList.txt 库路径更改为 boost_1_59_0 库路径。当我执行 cmake 时,此路径出现在库选项中。但是仍然缺少 boost_python3。我是新手,我尝试的只是谷歌的结果。 请帮忙。

最佳答案

在 Ubuntu 上,boost 的库名称是: libboost_pythonlibboost_python-py35libboost_python-py27

这意味着在 cmake 中,您需要将它们称为 python-py35 而不是 python3。或者,如果您不控制 CMakeLists.txt,您可以创建一个符号链接(symbolic link): /usr/lib/x86_64-linux-gnu/libboost_python-py35.so -> /usr/lib/x86_64-linux-gnu/libboost_python3.so

在我的 CMakeLists.txt 文件中,我有以下内容:

if(UNIX)
    set( BOOST_PYTHONLIB python-py35)
else()
    set( BOOST_PYTHONLIB python3)
endif()

find_package (Boost 1.58 REQUIRED COMPONENTS
    coroutine
    context
    filesystem
    program_options
    system
    thread
    ${BOOST_PYTHONLIB}
    chrono
    )

关于python - ubuntu 16.04 中缺少 boost_python3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39162622/

相关文章:

python - 如何在 Odoo 12v 中从销售订单、发票、采购订单、账单等 PDF 报告的第二页中删除页眉和页脚

python - YAML - 转储没有类型/标签的嵌套对象

GitLab。提交待定

git - 可以将 Android Studio 配置为在提交 Git 提交之前运行 gradle 任务吗?

git - 我需要将子模块文件夹添加到 .gitignore 中吗?

ubuntu - 编辑 .cfg 会使 Ubuntu 服务器卡在 vi 编辑器中

python - RuntimeError : The reset parameter is False but there is no n_features_in_ attribute. 是否安装了这个估算器?

javascript - Django 模板标签 {{for/empty}} for 循环变量

typescript - 通过 npm 与使用 native 包(通过 apt)为 Ubuntu 安装 typescript

docker - 在 Dockerfile 中设置 bind9 时面临问题