Python Forum
cx_freeze setup.py error: No module __SNMP-FRAMEWORK-MIB
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
cx_freeze setup.py error: No module __SNMP-FRAMEWORK-MIB
#1
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:
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
Reply


Messages In This Thread
cx_freeze setup.py error: No module __SNMP-FRAMEWORK-MIB - by nacho - Feb-18-2018, 07:57 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Error (Errno 2), File upload with the Flask framework and a public IP Username_Python1 0 131 Yesterday, 01:46 PM
Last Post: Username_Python1
  Problem with cx_freeze app only on one pc floatingshed 0 1,768 Mar-19-2021, 05:19 PM
Last Post: floatingshed
Exclamation Help with cx_Freeze mederic39 3 2,836 Jan-31-2021, 12:05 PM
Last Post: snippsat
  python setup.py install error blackclover 2 7,799 Jan-07-2021, 04:36 AM
Last Post: blackclover
  'python setup.py bdist' gets error on 'compiler_flags' 1780yz 0 2,172 Sep-02-2020, 09:17 PM
Last Post: 1780yz
  vlc module error pythonprogrammer 1 2,820 Apr-23-2020, 04:16 AM
Last Post: Larz60+
  cx_freeze frozen executive introduces WinError 10049 KipCarter 3 3,090 Jan-14-2020, 02:34 PM
Last Post: KipCarter
  Python 3.6 Alternatives to Cx_Freeze KipCarter 5 4,958 Jan-14-2020, 11:51 AM
Last Post: KipCarter
  cx_freeze exe does not work? Skycoder 4 6,261 Jan-13-2020, 06:50 PM
Last Post: KipCarter
  How to get cx_Freeze to make folders mad_accountant 0 3,036 Nov-24-2019, 02:22 PM
Last Post: mad_accountant

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020