德雷克源安装在 Ubuntu 20.04 上:找不到 Python

Drake source install on Ubuntu 20.04: Could NOT find Python

我正在尝试按照 here 的说明在 Ubuntu 20.04 上从源代码构建 drake。我已经检查过我的系统是否满足所有要求,并且能够成功 运行 强制性平台特定设置脚本(并且它完成时说:'install_prereqs: success')。但是,当我尝试 运行 cmake 构建 python 绑定时,我遇到了以下错误:

CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
  Could NOT find Python (missing: Python_NumPy_INCLUDE_DIRS NumPy) (found
  suitable exact version "3.8.10")
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.16/Modules/FindPython/Support.cmake:2214 (find_package_handle_standard_args)
  /usr/share/cmake-3.16/Modules/FindPython.cmake:304 (include)
  CMakeLists.txt:240 (find_package)


-- Configuring incomplete, errors occurred!

我似乎想不出发生这种情况的任何原因(我确保在注释 here 之后从我的 PATH 变量中删除 conda。非常感谢任何解决此问题的帮助!

编辑:想提一下,我正在尝试从 this PR 安装 Drake,其中包含我需要访问的功能。

这是我的 Ubuntu 20.04 系统的一些诊断输出。你能运行一样吗,然后检查一下是否有什么不同?

jwnimmer@call-cps:~$ which python
/usr/bin/python

jwnimmer@call-cps:~$ which python3
/usr/bin/python3

jwnimmer@call-cps:~$ file /usr/bin/python3
/usr/bin/python3: symbolic link to python3.8

jwnimmer@call-cps:~$ dpkg -l python3-numpy 
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version           Architecture Description
+++-==============-=================-============-============================================
ii  python3-numpy  1:1.17.4-5ubuntu3 amd64        Fast array facility to the Python 3 language

jwnimmer@call-cps:~$ ls -l /usr/include/python3.8/numpy
lrwxrwxrwx 1 root root 56 Feb 18  2020 /usr/include/python3.8/numpy -> ../../lib/python3/dist-packages/numpy/core/include/numpy

jwnimmer@call-cps:~$ ls -l /usr/lib/python3/dist-packages/numpy/core/include/numpy | head
total 388
-rw-r--r-- 1 root root   164 Jun 15  2019 arrayobject.h
-rw-r--r-- 1 root root  3509 Jun 15  2019 arrayscalars.h
-rw-r--r-- 1 root root  1878 Aug 30  2019 halffloat.h
-rw-r--r-- 1 root root 61098 Feb 18  2020 __multiarray_api.h
-rw-r--r-- 1 root root 56456 Feb 18  2020 multiarray_api.txt
-rw-r--r-- 1 root root 11496 Oct 15  2019 ndarrayobject.h
-rw-r--r-- 1 root root 65018 Nov  8  2019 ndarraytypes.h
-rw-r--r-- 1 root root  1861 Jun 15  2019 _neighborhood_iterator_imp.h
-rw-r--r-- 1 root root  6786 Aug 30  2019 noprefix.h

另一方面,您可以尝试通过(在 Drake 中)bazel run //:install -- /path/to/somewhere 安装 Drake 来临时解决这个问题,从而跳过似乎是这里问题的 CMake 内容。