如何使用cmake定位Jupyter Notebook安装

时间:2019-04-24 22:42:46

标签: cmake jupyter-notebook

是否可以使用cmake find_package()定位jupyter_notebook安装?

我尝试了

iOS

但是会错误

FIND_PACKAGE(jupyter-notebook REQUIRED)

但是,它已经安装:

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!

1 个答案:

答案 0 :(得分:1)

使用find_package命令MODULECONFIG时有一些选项。对于这种情况,您可能需要CONFIG设置。错误消息试图在这里提供帮助。这些文件中的任何一个都没有安装jupyter-notebook吗?

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

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

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笔记本电脑。

我建议花一些时间在find_package的{​​{3}}上,因为它明确列出了CMake用于查找软件包的搜索路径(按顺序)。另外,请查看此documentation