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

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

这是一个完整的初学者。

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

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

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

提前致谢

python pip snmp easysnmp
1个回答
1
投票

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

© www.soinside.com 2019 - 2024. All rights reserved.