首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用cmake查找jupyter notebook安装?

如何使用cmake查找jupyter notebook安装?
EN

Stack Overflow用户
提问于 2019-04-25 06:42:46
回答 1查看 496关注 0票数 0

有没有办法使用cmake find_package()来定位jupyter_notebook安装?

我试过了

代码语言:javascript
复制
FIND_PACKAGE(jupyter-notebook REQUIRED)

但是它错误地输出了

代码语言:javascript
复制
CMake Error at CMakeLists.txt:15 (FIND_PACKAGE):
  By not providing "Findjupyter-notebook.cmake" in CMAKE_MODULE_PATH this
  project has asked CMake to find a package configuration file provided by
  "jupyter-notebook", but CMake did not find one.

  Could not find a package configuration file provided by "jupyter-notebook"
  with any of the following names:

    jupyter-notebookConfig.cmake
    jupyter-notebook-config.cmake

  Add the installation prefix of "jupyter-notebook" to CMAKE_PREFIX_PATH or
  set "jupyter-notebook_DIR" to a directory containing one of the above
  files.  If "jupyter-notebook" provides a separate development package or
  SDK, be sure it has been installed.


-- Configuring incomplete, errors occurred!

但是,它已被安装:

代码语言:javascript
复制
apt-cache show jupyter-notebook
EN

回答 1

Stack Overflow用户

发布于 2019-04-25 10:42:58

使用find_package命令、MODULECONFIG时,有几个选项。对于这种情况,您可能需要CONFIG设置。错误消息试图在这里提供帮助。这些文件是否随jupyter-notebook安装一起提供?

代码语言:javascript
复制
jupyter-notebookConfig.cmake
jupyter-notebook-config.cmake

如果是这样,请尝试将CMAKE_PREFIX_PATHjupyter-notebook_DIR设置为jupyter-notebook的安装目录。因此,您可以尝试执行以下操作:

代码语言:javascript
复制
list(APPEND CMAKE_PREFIX_PATH /path/to/your/installation) # Try this one.
# SET(jupyter-notebook_DIR /path/to/your/installation) # Or try this one.
FIND_PACKAGE(jupyter-notebook CONFIG REQUIRED)

如果您的安装似乎没有前面提到的CMake配置文件,也没有任何CMake支持文件( cmake目录等),那么find_program命令可能更适合jupyter-notebook。

我建议花一些时间使用find_packagedocumentation,因为它显式地列出了CMake用来查找包的搜索路径(按顺序)。另外,请查看此answer

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55839524

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档