通过pip安装easysnmp时出错[Python]

时间:2016-03-03 13:34:21

标签: python pip snmp easysnmp

这里是一个完整的初学者。

我一直在尝试为python安装easysnmp库,而且我遇到了各种神秘的编译器相关错误,我已经解决了大部分问题,但是我已经解决了。我遇到了一个错误,我不知道如何解决:(抱歉这个巨大的错误信息)

Collecting easysnmp
  Using cached easysnmp-0.2.4.tar.gz
Building wheels for collected packages: easysnmp
  Running setup.py bdist_wheel for easysnmp ... error
  Complete output from command C:\Users\PC\Miniconda2\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\PC\\appdata\\local\\temp\\pip-build-fozy8z\\easysnmp\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d c:\users\PC\appdata\local\temp\tmpieeeempip-wheel- --python-tag cp27:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-2.7
  creating build\lib.win-amd64-2.7\easysnmp
  copying easysnmp\compat.py -> build\lib.win-amd64-2.7\easysnmp
  copying easysnmp\easy.py -> build\lib.win-amd64-2.7\easysnmp
  copying easysnmp\exceptions.py -> build\lib.win-amd64-2.7\easysnmp
  copying easysnmp\helpers.py -> build\lib.win-amd64-2.7\easysnmp
  copying easysnmp\session.py -> build\lib.win-amd64-2.7\easysnmp
  copying easysnmp\utils.py -> build\lib.win-amd64-2.7\easysnmp
  copying easysnmp\variables.py -> build\lib.win-amd64-2.7\easysnmp
  copying easysnmp\__init__.py -> build\lib.win-amd64-2.7\easysnmp
  running build_ext
  building 'easysnmp.interface' extension
  creating build\temp.win-amd64-2.7
  creating build\temp.win-amd64-2.7\Release
  creating build\temp.win-amd64-2.7\Release\easysnmp
  C:\Users\PC\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Users\PC\Miniconda2\include -IC:\Users\PC\Miniconda2\PC /Tceasysnmp/interface.c /Fobuild\temp.win-amd64-2.7\Release\easysnmp/interface.obj -Wno-unused-function
  cl : Command line error D8021 : invalid numeric argument '/Wno-unused-function'
  error: command 'C:\\Users\\PC\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2

  ----------------------------------------
  Failed building wheel for easysnmp
  Running setup.py clean for easysnmp
Failed to build easysnmp
Installing collected packages: easysnmp
  Running setup.py install for easysnmp ... error
    Complete output from command C:\Users\PC\Miniconda2\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\PC\\appdata\\local\\temp\\pip-build-fozy8z\\easysnmp\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\PC\appdata\local\temp\pip-lsjd2u-record\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-2.7
    creating build\lib.win-amd64-2.7\easysnmp
    copying easysnmp\compat.py -> build\lib.win-amd64-2.7\easysnmp
    copying easysnmp\easy.py -> build\lib.win-amd64-2.7\easysnmp
    copying easysnmp\exceptions.py -> build\lib.win-amd64-2.7\easysnmp
    copying easysnmp\helpers.py -> build\lib.win-amd64-2.7\easysnmp
    copying easysnmp\session.py -> build\lib.win-amd64-2.7\easysnmp
    copying easysnmp\utils.py -> build\lib.win-amd64-2.7\easysnmp
    copying easysnmp\variables.py -> build\lib.win-amd64-2.7\easysnmp
    copying easysnmp\__init__.py -> build\lib.win-amd64-2.7\easysnmp
    running build_ext
    building 'easysnmp.interface' extension
    creating build\temp.win-amd64-2.7
    creating build\temp.win-amd64-2.7\Release
    creating build\temp.win-amd64-2.7\Release\easysnmp
    C:\Users\PC\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Users\PC\Miniconda2\include -IC:\Users\PC\Miniconda2\PC /Tceasysnmp/interface.c /Fobuild\temp.win-amd64-2.7\Release\easysnmp/interface.obj -Wno-unused-function
    cl : Command line error D8021 : invalid numeric argument '/Wno-unused-function'
    error: command 'C:\\Users\\PC\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2

    ----------------------------------------
Command "C:\Users\PC\Miniconda2\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\PC\\appdata\\local\\temp\\pip-build-fozy8z\\easysnmp\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\PC\appdata\local\temp\pip-lsjd2u-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\PC\appdata\local\temp\pip-build-fozy8z\easysnmp

我不完全确定错误是与编译器相关还是与库本身有关,或者介于两者之间,我可以真正使用一些帮助。

提前致谢

1 个答案:

答案 0 :(得分:1)

不幸的是,目前Easysnmp软件包与Windows兼容。这已在issue #32中得到确认,已于2016年2月28日结束。