I want to use Pocketsphinx on my ROS2 workspace, but wanted to try it out on Turtlesim first. While building my workspace with

colcon build --packages-select pocketsphinx_package

I alwalys get this error:

CMake Error at CMakeLists.txt:13 (find_package):
  Could not find a package configuration file provided by "pocketsphinx" with
  any of the following names:


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

I installed pocketsphinx using the follwing commands:

sudo apt update

sudo apt install pocketsphinx

  • 1
    $\begingroup$ Where did you find ROS 2 pocketsphinx bindings? All I could find is ros-pocketsphinx which is not compatible with ROS 2. $\endgroup$ Dec 30, 2023 at 23:32
  • 1
    $\begingroup$ You're right, I didn't even check if it was compatible with ROS2! So I can't use pocketsphinx? Do you know another speech recognizer I can use? $\endgroup$
    – metaje
    Jan 4 at 13:56

1 Answer 1


You have probably not installed the development files for this library. Use apt to search for an apt package named something like pocketsphinx-dev and install it.

  • $\begingroup$ I searched for it and libpocketsphinx-dev is already installed. I also tried to set CMAKE_PREFIX_PATH to the right path, but I still get the same error. $\endgroup$
    – metaje
    Dec 30, 2023 at 23:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.