Okay, I have the same situation and can reproduce the bug.

I grep'ed around the system a bit and found files that handle import of
environmental variable PYSNMP_API_VERSION, which you already know:

[a...@alex-laptop:~]$ cd /usr/share/python-support/
[a...@alex-laptop:python-support]$ grep -rn PYSNMP_API_VERSION .
./pysnmp4-apps/pysnmp_apps/__init__.py:23:if
os.environ.has_key('PYSNMP_API_VERSION'):
./pysnmp4-apps/pysnmp_apps/__init__.py:24:    v =
os.environ['PYSNMP_API_VERSION']
./python-pysnmp-common/pysnmp/__init__.py:20:if
os.environ.has_key('PYSNMP_API_VERSION'):
./python-pysnmp-common/pysnmp/__init__.py:21:    v =
os.environ['PYSNMP_API_VERSION']
./pysnmp4-mibs/pysnmp_mibs/__init__.py:23:if
os.environ.has_key('PYSNMP_API_VERSION'):
./pysnmp4-mibs/pysnmp_mibs/__init__.py:24:    v =
os.environ['PYSNMP_API_VERSION']

So I poked around in those files and didn't find anything out of
ordinary. On my system by default variable PYSNMP_API_VERSION is unset,
I've tried setting it, verify that by running

>>> import os
>>> print os.environ.has_key('PYSNMP_API_VERSION')
>>> print os.environ['PYSNMP_API_VERSION']

and then running import statement 'from pysnmp.entity.rfc3413.oneliner
import cmdgen' but that didn't make any difference.

I also dumped sys.modules map since it seems that all the files I
mentioned above are just adding entries to sys.modules map. So here's
map before running 'from pysnmp.entity.rfc3413.oneliner import cmdgen'
import:
{'copy_reg': <module 'copy_reg' from '/usr/lib/python2.6/copy_reg.pyc'>,
'encodings': <module 'encodings' from
'/usr/lib/python2.6/encodings/__init__.pyc'>, 'site': <module 'site'
from '/usr/lib/python2.6/site.pyc'>, '__builtin__': <module
'__builtin__' (built-in)>, '__main__': <module '__main__' (built-in)>,
'encodings.encodings': None, 'abc': <module 'abc' from
'/usr/lib/python2.6/abc.pyc'>, 'posixpath': <module 'posixpath' from
'/usr/lib/python2.6/posixpath.pyc'>, 'errno': <module
'errno' (built-in)>, 'encodings.codecs': None, '_abcoll': <module
'_abcoll' from '/usr/lib/python2.6/_abcoll.pyc'>, 'types': <module
'types' from '/usr/lib/python2.6/types.pyc'>, '_codecs': <module
'_codecs' (built-in)>, '_warnings': <module '_warnings' (built-in)>,
'genericpath': <module 'genericpath' from
'/usr/lib/python2.6/genericpath.pyc'>, 'stat': <module 'stat' from
'/usr/lib/python2.6/stat.pyc'>, 'zipimport': <module
'zipimport' (built-in)>, 'encodings.__builtin__': None, 'warnings':
<module 'warnings' from '/usr/lib/python2.6/warnings.pyc'>, 'UserDict':
<module 'UserDict' from '/usr/lib/python2.6/UserDict.pyc'>,
'encodings.utf_8': <module 'encodings.utf_8' from
'/usr/lib/python2.6/encodings/utf_8.pyc'>, 'sys': <module
'sys' (built-in)>, 'codecs': <module 'codecs' from
'/usr/lib/python2.6/codecs.pyc'>, 'readline': <module 'readline' from
'/usr/lib/python2.6/lib-dynload/readline.so'>, 'os.path': <module
'posixpath' from '/usr/lib/python2.6/posixpath.pyc'>, 'sitecustomize':
<module 'sitecustomize' from '/usr/lib/python2.6/sitecustomize.pyc'>,
'signal': <module 'signal' (built-in)>, 'linecache': <module 'linecache'
from '/usr/lib/python2.6/linecache.pyc'>, 'posix': <module
'posix' (built-in)>, 'encodings.aliases': <module 'encodings.aliases'
from '/usr/lib/python2.6/encodings/aliases.pyc'>, 'exceptions': <module
'exceptions' (built-in)>, 'os': <module 'os' from
'/usr/lib/python2.6/os.pyc'>}

And here's its state after I ran that command from the interpreter:


{'cStringIO': <module 'cStringIO' (built-in)>, 'copy_reg': <module
'copy_reg' from '/usr/lib/python2.6/copy_reg.pyc'>, 'sre_compile':
<module 'sre_compile' from '/usr/lib/python2.6/sre_compile.pyc'>,
'_sre': <module '_sre' (built-in)>, 'encodings': <module 'encodings'
from '/usr/lib/python2.6/encodings/__init__.pyc'>, 'site': <module
'site' from '/usr/lib/python2.6/site.pyc'>, '__builtin__': <module
'__builtin__' (built-in)>, 'pysnmp.v4.entity.rfc3413.oneliner.types':
None, '_ssl': <module '_ssl' (built-in)>,
'pysnmp.v4.entity.rfc3413.oneliner.socket': None, '__main__': <module
'__main__' (built-in)>, 'encodings.encodings': None,
'pysnmp.v4.entity.rfc3413.oneliner.string': None, 'pysnmp.v4.entity':
<module 'pysnmp.v4.entity' from
'/usr/lib/pymodules/python2.6/pysnmp/v4/entity/__init__.pyc'>, 'abc':
<module 'abc' from '/usr/lib/python2.6/abc.pyc'>,
'pysnmp.v4.entity.rfc3413.oneliner.pysnmp': None, 'posixpath': <module
'posixpath' from '/usr/lib/python2.6/posixpath.pyc'>, 'errno': <module
'errno' (built-in)>, '_socket': <module '_socket' (built-in)>,
'encodings.codecs': None, 'sre_constants': <module 'sre_constants' from
'/usr/lib/python2.6/sre_constants.pyc'>, 're': <module 're' from
'/usr/lib/python2.6/re.pyc'>, '_abcoll': <module '_abcoll' from
'/usr/lib/python2.6/_abcoll.pyc'>, 'types': <module 'types' from
'/usr/lib/python2.6/types.pyc'>, '_codecs': <module
'_codecs' (built-in)>, '_warnings': <module '_warnings' (built-in)>,
'pysnmp.v4.entity.rfc3413.oneliner': <module
'pysnmp.v4.entity.rfc3413.oneliner' from
'/usr/lib/pymodules/python2.6/pysnmp/v4/entity/rfc3413/oneliner/__init__.pyc'>, 
'genericpath': <module 'genericpath' from 
'/usr/lib/python2.6/genericpath.pyc'>, 'stat': <module 'stat' from 
'/usr/lib/python2.6/stat.pyc'>, 'zipimport': <module 'zipimport' (built-in)>, 
'encodings.__builtin__': None, 'string': <module 'string' from 
'/usr/lib/python2.6/string.pyc'>, 'warnings': <module 'warnings' from 
'/usr/lib/python2.6/warnings.pyc'>, 'UserDict': <module 'UserDict' from 
'/usr/lib/python2.6/UserDict.pyc'>, 'encodings.utf_8': <module 
'encodings.utf_8' from '/usr/lib/python2.6/encodings/utf_8.pyc'>, 'sys': 
<module 'sys' (built-in)>, 'pysnmp.v4.entity.rfc3413': <module 
'pysnmp.v4.entity.rfc3413' from 
'/usr/lib/pymodules/python2.6/pysnmp/v4/entity/rfc3413/__init__.pyc'>, 
'codecs': <module 'codecs' from '/usr/lib/python2.6/codecs.pyc'>, 'readline': 
<module 'readline' from '/usr/lib/python2.6/lib-dynload/readline.so'>, 
'pysnmp': <module 'pysnmp' from 
'/usr/lib/pymodules/python2.6/pysnmp/__init__.pyc'>, 'os.path': <module 
'posixpath' from '/usr/lib/python2.6/posixpath.pyc'>, 'strop': <module 'strop' 
(built-in)>, 'sitecustomize': <module 'sitecustomize' from 
'/usr/lib/python2.6/sitecustomize.pyc'>, 'socket': <module 'socket' from 
'/usr/lib/python2.6/socket.pyc'>, 'signal': <module 'signal' (built-in)>, 
'linecache': <module 'linecache' from '/usr/lib/python2.6/linecache.pyc'>, 
'posix': <module 'posix' (built-in)>, 'encodings.aliases': <module 
'encodings.aliases' from '/usr/lib/python2.6/encodings/aliases.pyc'>, 
'exceptions': <module 'exceptions' (built-in)>, 'sre_parse': <module 
'sre_parse' from '/usr/lib/python2.6/sre_parse.pyc'>, 'os': <module 'os' from 
'/usr/lib/python2.6/os.pyc'>, 'pysnmp.v4': <module 'pysnmp.v4' from 
'/usr/lib/pymodules/python2.6/pysnmp/v4/__init__.pyc'>}

Not that several entities from the library pysnmp.v4 have null values.
If someone could only compare these to a working system variables, then
I might be able to find the root of the problem.

System Info: squeeze/sid

ii  libsnmp-base                         5.4.3~dfsg-1
SNMP (Simple Network Management Protocol) MI
ii  libsnmp-python                       5.4.3~dfsg-1
SNMP (Simple Network Management Protocol) Py
ii  libsnmp15                            5.4.3~dfsg-1
SNMP (Simple Network Management Protocol) li
ii  python-pysnmp-common                 4.1.9a-1
Python SNMP library for agents and managers 
ii  python-pysnmp4                       4.1.9a-1
Python SNMP library for agents and managers 
ii  python-pysnmp4-apps                  0.2.6a-1
Applications for the Python SNMP library
ii  python-pysnmp4-doc                   4.1.9a-1
Python SNMP library for agents and managers 
ii  python-pysnmp4-mibs                  0.0.5a-3
MIBs for the Python SNMP library
ii  snmp                                 5.4.3~dfsg-1
SNMP (Simple Network Management Protocol) ap
ii  snmp-mibs-downloader                 1.1
Install and manage Management Information Ba
ii  snmpd                                5.4.3~dfsg-1
SNMP (Simple Network Management Protocol) ag


Alex





--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to