我在构建过程中遇到此错误
CMake Error at /opt/cmake-3.21.1-linux-x86_64/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find Python (missing: Python_NumPy_INCLUDE_DIRS NumPy) (found
version "2.7.17")
Call Stack (most recent call first):
/opt/cmake-3.21.1-linux-x86_64/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
/opt/cmake-3.21.1-linux-x86_64/share/cmake-3.21/Modules/FindPython.cmake:556 (find_package_handle_standard_args)
faiss/python/CMakeLists.txt:116 (find_package)
Run Code Online (Sandbox Code Playgroud)
我已经安装sudo apt-get install python-dev并尝试添加
-DPYTHON_INCLUDE_DIR=$(python -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") \
-DPYTHON_LIBRARY=$(python -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('LIBDIR'))")
Run Code Online (Sandbox Code Playgroud)
仍然得到同样的错误。我的python/home/dfw/anaconda3/bin/python版本是3.7.11。我的cmake版本是3.21.1。我怎样才能解决这个问题?