我试图通过运行fastecdsa在macOS BigSur (M1芯片)上安装
(venv) $ pip3 install fastecdsa即使我以前安装了gmp
$ brew install gmp它找不到自由,无论我做什么
src/curve.h:4:10: fatal error: 'gmp.h' file not found
#include "gmp.h"虽然当我创建一个符号链接时,错误发生了变化
ln -s /opt/homebrew/include/gmp.h /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include现在我明白了:
ld: library not found for -lgmp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/bin/gcc' failed with exit code 1我也试过:
CFLAGS、LDFLAGS和全局env导出(export CFLAGS=...)传递路径LDFLAGS=-L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib pip3 install fastecdsaCFLAGS=-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include pip3 install fastecdsaxcode-select --installbrew uninstall gmp和brew install gmp,甚至brew reinstall gmp和brew unlink gmp我不能把我的手指放在上面:
发布于 2022-04-21 02:11:04
使用setup.py作为映像安装和修改setup.py
发布于 2022-01-06 12:45:04
到目前为止,您可能已经解决了这一问题,但仅仅是说我遇到了类似的情况,而我的解决方案是告诉ld查看自制的库路径。运行这个/将它添加到~/.profile
export LIBRARY_PATH=$LIBRARY_PATH:/opt/homebrew/lib
export INCLUDE_PATH=$INCLUDE_PATH:/opt/homebrew/include(在我的情况下,我不需要INCLUDE_PATH,但看起来你可能需要!)
之后,您的python命令可能会开始工作!
https://stackoverflow.com/questions/68827486
复制相似问题