Unable to import jetson_utils

Hi,
When i try to import jetson_utils i get the following error.

ps_nithin@ubuntu:~/pyvision-temp$ python3
Python 3.10.12 (main, Nov 6 2024, 20:22:13) [GCC 11.4.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

import jetson_utils

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.2 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 “”, line 1, in
File “/usr/lib/python3.10/dist-packages/jetson_utils/init.py”, line 4, in
from jetson_utils_python import *
AttributeError: _ARRAY_API not found
Traceback (most recent call last):
File “”, line 1, in
File “/usr/lib/python3.10/dist-packages/jetson_utils/init.py”, line 4, in
from jetson_utils_python import *
SystemError: initialization of jetson_utils_python raised unreported exception

Thanks,

pip install "numpy<2.0"

You should do all of your python work in venv,

sudo apt install python3-venv
python3.10 -m venv my-venv
source my-venv/bin/activate
deactivate

Install all of your packages inside the venv. What has just happened with that package is a good example. You can break other stuff with a system wide downgrade or even an upgrade to satisfy package requirements. I highly suggest NOT to downgrade on a system level, do it all in a venv.

Is it possible to compile jetson_utils from source with numpy>2 support.

Hi,

Do you need NumPy > 2 for other dependencies?
jetson_utils is an open-sourced library and support you can modify it to use NumPy 2 with the source below:

Thanks.

I don’t have any other dependencies for numpy2 other than jetson_utils. I am not sure how to modify jetson_utils source to support numpy2.

Hi,

If so, it’s more recommended to downgrade the NumPy to 1.x so jetson_utils can work without modification.

Thanks.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.