我正在尝试 pip install easysnmp。我已经安装了 net-snmp 和 gcc 及其最新版本。我收到以下错误。
error: /Library/Developer/CommandLineTools/usr/bin/otool-classic: can't open file: build/lib.macosx-13-arm64-cpython-310/easysnmp/interface.cpython-310-darwin.so (No such file or directory)
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/private/var/folders/hz/w1sgkjbx5mdbwwmkrghb2j3m0000gn/T/pip-install-r3syy2lu/easysnmp_7cd15fcc88384ce19ce8588bd0e6c2b3/setup.py", line 179, in <module>
linked, target_lib, b.build_platlib, ext),
NameError: name 'target_lib' is not defined. Did you mean: 'target_libs'?
如果重要的话,我在 m1 上使用 macos ventura。
Mac OS 及其查找 Net-SNMP 包的方式似乎存在问题(如此处所示 -> https://github.com/easysnmp/easysnmp/issues/171)
要解决并让
easysnmp
运行,请执行以下操作:
# installing net-snmp
brew update && brew install net-snmp
# installing from the test repo as documented in the issue
pip3 install https://github.com/easysnmp/easysnmp/archive/refs/heads/test.zip