ros2
test_error
ai_generated
true
colcon test: Failed to find test dependencies: 'python3-pytest', 'ros_testing' not installed
ID: ros2/colcon-test-failure-test-dependencies-not-installed
88%Fix Rate
85%Confidence
1Evidence
2024-01-20First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| Humble | active | — | — | — |
| Iron | active | — | — | — |
| Rolling | active | — | — | — |
Root Cause
colcon test requires test dependencies specified in package.xml (under <test_depend>) to be installed in the workspace. Missing system or ROS packages cause test execution to fail.
generic中文
colcon test需要安装package.xml中指定的测试依赖项(位于<test_depend>下)。缺少系统或ROS包会导致测试执行失败。
Official Documentation
https://docs.ros.org/en/rolling/Tutorials/Beginner-Client-Libraries/Writing-A-Simple-Py-Package.html#test-your-packageWorkarounds
-
90% success Install test dependencies explicitly: rosdep install --from-paths src --ignore-src -r -y --rosdistro humble --include-test-dependencies. Then run colcon test again.
Install test dependencies explicitly: rosdep install --from-paths src --ignore-src -r -y --rosdistro humble --include-test-dependencies. Then run colcon test again.
-
85% success For missing system packages like python3-pytest, install manually: sudo apt-get install python3-pytest. For ROS packages like ros_testing: sudo apt-get install ros-humble-ros-testing.
For missing system packages like python3-pytest, install manually: sudo apt-get install python3-pytest. For ROS packages like ros_testing: sudo apt-get install ros-humble-ros-testing.
-
70% success If test dependencies are optional, temporarily remove them from package.xml and run colcon test with --packages-skip-build-failed to skip problematic packages.
If test dependencies are optional, temporarily remove them from package.xml and run colcon test with --packages-skip-build-failed to skip problematic packages.
中文步骤
Install test dependencies explicitly: rosdep install --from-paths src --ignore-src -r -y --rosdistro humble --include-test-dependencies. Then run colcon test again.
For missing system packages like python3-pytest, install manually: sudo apt-get install python3-pytest. For ROS packages like ros_testing: sudo apt-get install ros-humble-ros-testing.
If test dependencies are optional, temporarily remove them from package.xml and run colcon test with --packages-skip-build-failed to skip problematic packages.
Dead Ends
Common approaches that don't work:
-
95% fail
The error will still occur for the selected package if dependencies are missing. The --packages-select flag doesn't bypass dependency resolution.
-
85% fail
This command by default skips test dependencies unless --rosdistro and --include-test-dependencies are specified.