Giter VIP home page Giter VIP logo

Comments (7)

markliederbach avatar markliederbach commented on May 16, 2024

Paging @kamakazikamikaze , I am also experiencing this. Can you enlighten us as to how we should be installing this package from source like this?

from easysnmp.

 avatar commented on May 16, 2024

Try this:
pip uninstall easysnmp
pip install git+https://github.com/kamakazikamikaze/easysnmp.git

from easysnmp.

markliederbach avatar markliederbach commented on May 16, 2024

That works, but why? Sort of confusing that git works but a local install won't.

from easysnmp.

 avatar commented on May 16, 2024

I believe it has to do with the dependencies. Easy SNMP is built on top of NET-SNMP. If you check your versions snmpget --version NET-SNMP may have changed.

from easysnmp.

tpd001 avatar tpd001 commented on May 16, 2024

Similar experience, Python 3.6 / Miniconda / NetSNMP 5.7.3:

(cenv) [collector@monitoring portal]$python3.6  
Python 3.6.3 |Anaconda, Inc.| (default, Nov 20 2017, 20:41:42) 
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from easysnmp import Session
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/collector/miniconda3/lib/python3.6/site-packages/easysnmp/__init__.py", line 1, in <module>
from .easy import (  # noqa
File "/home/collector/miniconda3/lib/python3.6/site-packages/easysnmp/easy.py", line 3, in <module>
from .session import Session
File "/home/collector/miniconda3/lib/python3.6/site-packages/easysnmp/session.py", line 8, in <module>
from . import interface
ImportError: /home/collector/miniconda3/lib/python3.6/site-packages/easysnmp/interface.cpython-36m-x86_64-linux-gnu.so: undefined symbol: usmAESPrivProtocol

Note the interface.cpython-36m-x86_64-linux-gnu.so library does not have a dependency on libnetsnmp.so, which contains the symbol:

(cenv) [collector@monitoring portal]$ldd /home/collector/miniconda3/lib/python3.6/site-packages/easysnmp/interface.cpython-36m-x86_64-linux-gnu.so 
linux-vdso.so.1 =>  (0x00007fff3b7ff000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fda2432f000)
libc.so.6 => /lib64/libc.so.6 (0x00007fda23f9a000)
/lib64/ld-linux-x86-64.so.2 (0x00000034c0400000)

(cenv) [collector@monitoring portal]$nm -ng /usr/local/lib/libnetsnmp.so  | grep usmAESPrivProtocol
00000000002a5b60 D usmAESPrivProtocol

Tracing this back to installation:

(cenv) [collector@monitoring portal]$pip install easysnmp -v --no-cache-dir | more
Collecting easysnmp
...
/bin/sh: net-snmp-config: command not found   <====== 

Is there a reason 'pip install' does not fail at this point?

Thank you
Tim

from easysnmp.

WhittlesJr avatar WhittlesJr commented on May 16, 2024

This may not be helpful to anyone else, but I'll leave a breadcrumb:

I had the same issue trying to package this on NixOS. The solution was:

{
  postFixup = ''
    patchelf --add-needed ${pkgs.net_snmp}/lib/libnetsnmp.so "$out/${python.sitePackages}/easysnmp/"*cpython*.so
  '';
}

Again, it's only strictly useful for NixOS, but maybe it can give someone a hint if they run into the same problem packaging easysnmp on another distro.

from easysnmp.

WhittlesJr avatar WhittlesJr commented on May 16, 2024

Update: A simpler solution turned out to be using the --basedir= flag to specify the location of the net-snmp-config executable. (Which for me would be ${pkgs.net_snmp}/bin)

from easysnmp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.