Feb-18-2018, 07:57 PM
Hello all.
Firstly I run the following:
Windows 10 Enterprise 64-bit
Python 3.6.4
pysnmp 4.4.4
pyasn1 0.2.3
paramiko for ssh
tkinter as a GUI
All on Visual Studio Code v1.20.1
I actually raised this in a Stack Overflow forum (MibNotFoundError) and was advised (I think) to come here as I couldn't locate any online forums specifically dedicated to cx_freeze.
I made an app that adds/removes vlans and sends an snmp trap each time this is done. It all works fine when running just as a python script. When I assemble the exe using cx_freeze everything works EXCEPT that it doesn't send the trap and presents with the following error:
Traceback (most recent call last):
File "C:\Python\Python36-32\lib\tkinter\__init__.py", line 1699, in __call__
return self.func(*args)
File "snmpTester.py", line 56, in LabAccess
File "snmpTester.py", line 34, in sendTrap
File "C:\Python\Python36-32\lib\site-packages\pysnmp\entity\engine.py", line 91, in __init__
'__SNMP-FRAMEWORK-MIB', 'snmpEngineMaxMessageSize')
File "C:\Python\Python36-32\lib\site-packages\pysnmp\smi\builder.py", line 409, in importSymbols
'No module %s loaded at %s' % (modName, self)
pysnmp.smi.error.MibNotFoundError: No module __SNMP-FRAMEWORK-MIB loaded at <pysnmp.smi.builder.MibBuilder object at 0x03FD51B0>
When I enter the "python snmpSetup.py build" command to create the exe file, among all the other stuff that shows in the cmd window, I do see the above module successfully copied over:
<snip>
copying C:\Python\Python36-32\Lib\site-packages\pysnmp\smi\mibs\instances\__SNMP-FRAMEWORK-MIB.py -> build\exe.win32-3.6\mibs\instances\__SNMP-FRAMEWORK-MIB.py
<snip>
I have confirmed that the "__SNMP-FRAMEWORK-MIB.py" file is located in the instances folder as per the code in my setup.py file:
Thanks for any help
Cheers
Firstly I run the following:
Windows 10 Enterprise 64-bit
Python 3.6.4
pysnmp 4.4.4
pyasn1 0.2.3
paramiko for ssh
tkinter as a GUI
All on Visual Studio Code v1.20.1
I actually raised this in a Stack Overflow forum (MibNotFoundError) and was advised (I think) to come here as I couldn't locate any online forums specifically dedicated to cx_freeze.
I made an app that adds/removes vlans and sends an snmp trap each time this is done. It all works fine when running just as a python script. When I assemble the exe using cx_freeze everything works EXCEPT that it doesn't send the trap and presents with the following error:
Traceback (most recent call last):
File "C:\Python\Python36-32\lib\tkinter\__init__.py", line 1699, in __call__
return self.func(*args)
File "snmpTester.py", line 56, in LabAccess
File "snmpTester.py", line 34, in sendTrap
File "C:\Python\Python36-32\lib\site-packages\pysnmp\entity\engine.py", line 91, in __init__
'__SNMP-FRAMEWORK-MIB', 'snmpEngineMaxMessageSize')
File "C:\Python\Python36-32\lib\site-packages\pysnmp\smi\builder.py", line 409, in importSymbols
'No module %s loaded at %s' % (modName, self)
pysnmp.smi.error.MibNotFoundError: No module __SNMP-FRAMEWORK-MIB loaded at <pysnmp.smi.builder.MibBuilder object at 0x03FD51B0>
When I enter the "python snmpSetup.py build" command to create the exe file, among all the other stuff that shows in the cmd window, I do see the above module successfully copied over:
<snip>
copying C:\Python\Python36-32\Lib\site-packages\pysnmp\smi\mibs\instances\__SNMP-FRAMEWORK-MIB.py -> build\exe.win32-3.6\mibs\instances\__SNMP-FRAMEWORK-MIB.py
<snip>
I have confirmed that the "__SNMP-FRAMEWORK-MIB.py" file is located in the instances folder as per the code in my setup.py file:
options = { 'build_exe': { #'packages':packages, 'include_files':[ os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tk86t.dll'), os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tcl86t.dll'), 'C:\\Python\\Python36-32\\Lib\\site-packages\\idna', 'C:\\Python\\Python36-32\\Lib\\site-packages\\pysnmp\\smi\\mibs', 'C:\\Python\\Python36-32\\Lib\\site-packages\\pysnmp\\smi\\mibs\\instances' ], }, }Can anyone see where I'm going wrong? If you need more info please let me know as I didn't want to make my first post here too long and there are already many details in the Stack Overflow post that I did.
Thanks for any help
Cheers