
我正在 Termux 中安裝 numpy。當我運行時pip install numpy --no-cache-dir
,錯誤是:
File "/data/data/com.termux/files/usr/tmp/pip-install-ywfqxfk8/numpy_cf9d5c136bf14c7f9ce4181f190e4581/numpy/core/setup.py", line 171, in check_math_capabilities
raise SystemError("One of the required function to build numpy is not"
SystemError: One of the required function to build numpy is not available (the list is ['sin', 'cos', 'tan', 'sinh', 'cosh', 'tanh', 'fabs', 'floor', 'ceil', 'sqrt', 'log10', 'log', 'exp', 'asin', 'acos', 'atan', 'fmod', 'modf', 'frexp', 'ldexp']).
有完整的輸出:https://pastebin.com/ExnbqtDc。為什麼會發生這種情況以及如何解決?
軟體包wheel和setuptools已安裝。
答案1
使用:
MATHLIB="m" pip3 install numpy
答案2
我不知道為什麼,但這也有效,對於 Termux 來說似乎更快:
LDFLAGS="-lm -lcompiler_rt" pip install cython numpy