解决:安装torch_geometric后,import torch出现A module that was compiled using NumPy 1.x cannot be run in NumPy 2.0.2 as it may crash.
最近实验中需要使用torch_geometric库,在安装后import torch和import torch_geometric均出现报错:
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.
ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject