https://bbs.huaweicloud.com/forum/thread-50114-1-1.html 1. wget https://files.pythonhosted.org/packages/84/1e/ff467ac56bfeaea51d4a2e72d315c1fe440b20192fea7e460f0f248acac8/numpy-1.18.2.zip 2. unzip numpy-1.18.2.zip 3. 根据https://github.com/numpy/numpy/issues/13622上的建议,修改npy_math_internal.h.src文件 --- numpy/core/src/npymath/npy_math_internal.h.src.orig 2019-11-14 12:20:01.387180922 +0000 +++ numpy/core/src/npymath/npy_math_internal.h.src 2019-11-14 12:19:17.960646234 +0000 @@ -477,7 +477,7 @@ * #KIND = ATAN2,HYPOT,POW,FMOD,COPYSIGN# */ #ifdef HAVE_@KIND@@C@ -NPY_INPLACE @type@ npy_@kind@@c@(@type@ x, @type@ y) +NPY_INPLACE __attribute__((optimize("-O0"))) @type@ npy_@kind@@c@(@type@ x, @type@ y) { return @kind@@c@(x, y); } 4. cd numpy-1.18.2/ 5. python3 setup.py build 6. python3 setup.py install -O1 --skip-build --root /tmp/test_numpy 7. pip list可以查看安装成功