Why can'I import torch? OSError:libmpi_cxx.so.40

chenyh@chenyh-desktop:~$ python
Python 3.8.16 (default, Dec 7 2022, 01:12:13)
[GCC 7.5.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

import torch
Traceback (most recent call last):
File “”, line 1, in
File “/home/chenyh/.local/lib/python3.8/site-packages/torch/init.py”, line 198, in
File “/home/chenyh/.local/lib/python3.8/site-packages/torch/init.py”, line 151, in _load_global_deps
ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL)
File “/usr/lib/python3.8/ctypes/init.py”, line 373, in init
self._handle = _dlopen(self._name, mode)
OSError: libmpi_cxx.so.40: cannot open shared object file: No such file or directory

pytorch version is 1.11.0 with JetPack 4.6.1

Hi @1419912410, that PyTorch 1.11 wheel is for JetPack 5 and Ubuntu 20.04. The last PyTorch wheel to support JetPack 4 and Ubuntu 18.04 was PyTorch 1.10:

PyTorch for Jetson

  • JetPack 4.4 (L4T R32.4.3) / JetPack 4.4.1 (L4T R32.4.4) / JetPack 4.5 (L4T R32.5.0) / JetPack 4.5.1 (L4T R32.5.1) / JetPack 4.6 (L4T R32.6.1)

Please uninstall the PyTorch 1.10 and install 1.11 for Python 3.6. If you require Python 3.8 for JetPack 4, you will need to build PyTorch from source.

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