SNMP support for Python under Windows
I'm looking for SNMP support in Python. I have found pySNMP, but I'm
not sure whether this works under Windows as well. A few questions:
1) Where do I need to install the pySNMP files?
2) What do I have to do in order to be able to write somethin like:
"from pysnmp import session"
Thakns in advance for all input
Re: SNMP support for Python under Windows
> I'm looking for SNMP support in Python. I have found pySNMP, but I'm
> not sure whether this works under Windows as well.
Yes, it does.
> A few questions:
> 1) Where do I need to install the pySNMP files?
Doesn't it install with distutils? If so "python setup.py --install"
or whatever it says in the README would work. Sorry, I haven't
installed it lately.
If it doesn't have instructions, put the files under the
> 2) What do I have to do in order to be able to write somethin like:
> "from pysnmp import session"
Install, then type "from pysnmp import session".... ;-)
> Thakns in advance for all input
(If you're having troubles, please note versions and platform
next time, for Python, PySNMP, and Windows.)
Re: SNMP support for Python under Windows
Thanks for this useful information. I tried this on my Windows2000
system and it seems to work. I used distutils and modified the PATH
entry. I'll check on my Windows XP machine and will let you know if I
found any discrepancy.
Thanks again for all your effort. I have another question, but will
put that in a separate message on this discussion forum. Any help is
Peter Hansen <firstname.lastname@example.org> wrote in message news:<3F0CB4ED.C195374F@engcorp.com>...
> WIWA wrote:
> > I did two things, both unsuccessfull:
> > 1) If I install the pySNMP modules under lib/site-packages and then
> > type sth like:
> > from pysnmp import session it gives the error message "ImportError: No
> > module named pysnmp". The same happens if I unstall pySNMP directly
> > under the lib directory. Installs in this context means 'copy paste'
> > the *.py files of the pySNMP distribution.
> I misled you the first time, but have since taken another look
> at the installation to see how it works. In order to import
> anything from a package (roughly, a set of .py files that includes an
> __init__.py file), you need to put those files in a directory
> which is named for the package (e.g. pysnmp in this case) _and_
> which is available in sys.path. (Do "import sys" and "sys.path"
> to see the list. You probably have lib/site-packages in that
> list, so just put all the PySNMP files under it in a folder called
> > - Do I need to explicitly mention in my script where pySNMP is
> > installed?
> Not if it's in a folder called pysnmp that is itself in one of the
> sys.path folders, or under the current folder.
> > 2) I installed distutils 1.0.2 for Windows and it installed into the
> > Python directory. So ar so good, I think...
> Distutils is included in Python so you probably didn't need to do
> that, and maybe shouldn't have. I'm not sure whether that will have
> broken the standard distutils. It's repairable if it did. On my
> Python 2.2.1 setup here, the standard distutils is v1.0.3.
> > I go to DOS prompt and go to the directory where disutils is installed
> > and type in python setup.py install, but DOS replies:
> > 'Python is not recognized as an internal or external command, program
> > or batchfile".
> Now that's a different problem. You need python.exe to be findable
> from the DOS PATH. The simplest approach might be to check the FAQ
> entry at http://www.python.org/cgi-bin/faqw.p...=faq08.018.htp
> As a test of the pysnmp installation, without having to change PATH
> at all, change to the Python directory ("cd \python" or whatever)
> and run the interactive interpreter ("python") and just type
> "import pysnmp" to see if it works.
> > System coordinates are Windows XP. Python version is 2.2.2 and pySNMP
> > is version 3.0.0.
> Should all be no problem, although I suspect instructions in that
> FAQ entry may be a little light on XP advice. Let us know if you
> see any area that could be improved so others can benefit from this
|All times are GMT. The time now is 10:17 PM.|
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.