在 mac 中使用 pip 安装 Easysnmp 失败

问题描述 投票:0回答:1

我正在尝试 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。

pip snmp net-snmp easysnmp
1个回答
0
投票

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
© www.soinside.com 2019 - 2024. All rights reserved.