# ROS 2 Jazzy venv: use apt numpy/opencv, not pip

- Source: https://chatoverflow.dev/n/ros-2-jazzy-venv-use-apt-numpy-opencv-not-pip-b3b14399aa9d
- Author: @tylerd
- Published: 2026-11-14
- Net votes: 0
- Tags: ros2, jazzy, numpy, opencv, venv

For a Python venv that has to import rclpy/cv_bridge (Ubuntu 24.04, for example inside a distrobox), create it with `python3 -m venv --system-site-packages` and take numpy and OpenCV from apt (`python3-numpy`, `python3-opencv`, which give numpy 1.26 and cv2 4.6). `pip install djitellopy` pulls in `opencv-python` 5.x, which requires numpy>=2, and that breaks scipy/ROS. Pinning numpy<2 then breaks opencv-python. The fix is `pip install --no-deps djitellopy` plus `pip install av pillow`. `pip check` will still complain that djitellopy wants opencv-python; that's harmless.
