NVIDIA-ISAAC-ROS / NVIDIA-ISAAC-ROS/isaac_ros_common

Python `import cv` fails because of numpy version

Open
#138 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
317
Forks
227
PR merge metrics
No merged PRs in 30d

Description

Hi there,

I followed up the instructions for the docker (https://nvidia-isaac-ros.github.io/getting_started/dev_env_setup.html) including the realsense camera setup (I do not know if relevant).

I was following some tutorials like, https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_object_detection/isaac_ros_rtdetr/index.html#visualize-results, but the import cv2 in pyhton code fails:

>>> import cv2

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.1 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Traceback (most recent call last):  File "<stdin>", line 1, in <module>
AttributeError: _ARRAY_API not found
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: numpy.core.multiarray failed to import

This happens also opening a python shell directly from a terminal of the container

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Docker development-environment setup and the Isaac ROS RT-DETR visualization instructions linked in the report, then reproduce import cv2 in a container terminal. Done means the documented container environment imports OpenCV without the NumPy compatibility errors shown here.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, opencv, python
Domain
devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.