# Using ultralytics with ROS2 Humble

**URL:** <https://community.ultralytics.com/t/using-ultralytics-with-ros2-humble/1473>\
**Category:** Support\
**Tags:** troubleshooting, support, yolo\
**Created:** [September 19, 2025, 7:30pm UTC](https://community.ultralytics.com/t/using-ultralytics-with-ros2-humble/1473 "2025-09-19T19:30:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![simrobo](https://avatars.discourse-cdn.com/v4/letter/s/dbc845/32.png) [@simrobo](https://community.ultralytics.com/u/simrobo)\
**Post date:** [September 19, 2025, 7:30pm UTC](https://community.ultralytics.com/t/using-ultralytics-with-ros2-humble/1473/1 "2025-09-19T19:30:47Z")

</div>

I’m attempting to create a ROS2 (Humble) node (Python) that receives image data from a ROS2 publisher (Isaac Sim) and performs predictions on the images using the predict() method on a YOLO model.

The problem I’ve run into is that ROS2 (specifically its cv\_bridge utility) requires an old version of numpy (\< 2.0) while the current ultralytics library requires something \> 2.

I’ve actually managed to get this node to work by deleting the newer numpy version pulled in during the ultralytics install (the system then finds an older version of numpy that’s installed) but I’m hoping there’s a cleaner solution.

Thank you.

---

<div class="post-metadata">

**Author:** ![Toxite](https://sea1.discourse-cdn.com/flex001/user_avatar/community.ultralytics.com/toxite/32/123_2.png) [@Toxite](https://community.ultralytics.com/u/Toxite)\
**Post date:** [September 20, 2025, 4:43am UTC](https://community.ultralytics.com/t/using-ultralytics-with-ros2-humble/1473/2 "2025-09-20T04:43:34Z")

</div>

Ultralytics doesn’t require `numpy>2`, but if you don’t specify any version, then pip willl install the latest.

You can specify `numpy` version during installation.

```auto
pip install ultralytics "numpy<2"

```

---

<div class="post-metadata">

**Author:** ![simrobo](https://avatars.discourse-cdn.com/v4/letter/s/dbc845/32.png) [@simrobo](https://community.ultralytics.com/u/simrobo)\
**Post date:** [September 20, 2025, 1:13pm UTC](https://community.ultralytics.com/t/using-ultralytics-with-ros2-humble/1473/3 "2025-09-20T13:13:12Z")

</div>

Thank you!

---

<div class="post-metadata">

**Author:** ![pderrenger](https://sea1.discourse-cdn.com/flex001/user_avatar/community.ultralytics.com/pderrenger/32/73_2.png) [@pderrenger](https://community.ultralytics.com/u/pderrenger)\
**Post date:** [September 21, 2025, 1:27pm UTC](https://community.ultralytics.com/t/using-ultralytics-with-ros2-humble/1473/4 "2025-09-21T13:27:39Z")

</div>

Glad it’s sorted! For a clean, reproducible setup with ROS2 Humble, pin NumPy\<2 (1.26.x is a safe choice) and consider `opencv-python-headless` for headless ROS nodes. Example:

requirements.txt

```auto
ultralytics
numpy<2
opencv-python-headless

```

Install with:

```auto
pip install -r requirements.txt

```

If you need tighter control over dependencies, check the custom installation methods in our Install Ultralytics guide, which shows options like `--no-deps` and pinning via a fork [custom installation methods](https://docs.ultralytics.com/quickstart/).
