找不到模块netsmnp安装错误

时间:2020-07-03 03:49:01

标签: python-2.7

我正在尝试在Mac中安装net_snmp,但出现模块错误。我尝试了以下命令。

pip install netsnmp-py



  gcc -fno-strict-aliasing -I/opt/anaconda3/envs/env2/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I./netsnmp -I/opt/anaconda3/envs/env2/include/python2.7 -c netsnmp/session.c -o build/temp.macosx-10.7-x86_64-2.7/netsnmp/session.o
  netsnmp/session.c:5:10: fatal error: 'net-snmp/net-snmp-features.h' file not found
  #include <net-snmp/net-snmp-features.h>
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1 error generated.
  error: command 'gcc' failed with exit status 1

    gcc -fno-strict-aliasing -I/opt/anaconda3/envs/env2/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I./netsnmp -I/opt/anaconda3/envs/env2/include/python2.7 -c netsnmp/session.c -o build/temp.macosx-10.7-x86_64-2.7/netsnmp/session.o
    netsnmp/session.c:5:10: fatal error: 'net-snmp/net-snmp-features.h' file not found
    #include <net-snmp/net-snmp-features.h>
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1 error generated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /opt/anaconda3/envs/env2/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/ht/3j7bh04x7yd9lsclfs_p6hd00000gr/T/pip-install-HKVcVd/netsnmp-py/setup.py'"'"'; __file__='"'"'/private/var/folders/ht/3j7bh04x7yd9lsclfs_p6hd00000gr/T/pip-install-HKVcVd/netsnmp-py/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/ht/3j7bh04x7yd9lsclfs_p6hd00000gr/T/pip-record-vjo31F/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.

我也尝试过

brew install net_snmp

它表明net-smnp已经安装。

但是当我import netsnmp.

我遇到了错误,找不到模块。我正在尝试在Mac上做所有这些事情

0 个答案:

没有答案
相关问题