0

I'm trying to build drake from source on Ubuntu 20.04 by following instructions from here. I already checked that my system meets all the requirements, and was ale to successfully run the mandatory platform-specific setup script (and it completed saying: 'install_prereqs: success'). However, when I try to run cmake to build the python bindings, I'm confronted with the following error:

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!

I can't seem to think of any reason why this is happening (I made sure to remove conda from my PATH variable following the note here. Any help around this issue is much appreciated!

EDIT: Want to mention that I'm trying to install Drake from this PR that includes a feature I need access to.

njk23
  • 77
  • 1
  • 10
  • For the historical record, please edit your post above to state which git revision of Drake you're trying to use. – jwnimmer-tri Nov 29 '21 at 23:14
  • The Drake code just does `find_package(Python 3 EXACT MODULE REQUIRED COMPONENTS Development Interpreter NumPy)`, which seems like bog-standardard CMake to me. It's probably worth adding the "#cmake" tag to this question, since it's really a "why does CMake hate me" question, not really a Drake question. – jwnimmer-tri Nov 30 '21 at 01:21

2 Answers2

1

On another tack, you could try to temporarily work around the problem by doing (in Drake) a bazel run //:install -- /path/to/somewhere to install Drake, and thus skipping the CMake stuff that seems to be the problem here.

jwnimmer-tri
  • 1,994
  • 2
  • 5
  • 6
0

Here is some diagnostic output from my Ubuntu 20.04 system. Can you run the same, and check to see if anything looks different?

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
jwnimmer-tri
  • 1,994
  • 2
  • 5
  • 6