Importing the numpy C-extensions failed.

文章目录


前言

在C++程序里导入Python中的Numpy库时发生错误。

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

解决方法

win + r 打开终端

pip uninstall -y numpy
pip uninsall -y setuptools
pip install setuptools
pip install numpy

总结

之前运行并没有出现这个问题,但是偶然一天运行发现报错,可以试试这个方法。

猜你喜欢

转载自blog.csdn.net/Dbojuedzw/article/details/127176863