How to fix Module Not Named error

When an error is being thrown in the opcd.log showing that a specific module is not being found then you are most likely dealing with a rights issue with the modules folders and files. The error will look similar to the following:

Traceback (most recent call last):
 File "/home/blazemeter/agent/", line 5, in <module>
 import command_handler
 File "/home/blazemeter/agent/", line 13, in <module>
 from container_management.mesos_manager import MesosManager
 File "/home/blazemeter/agent/container_management/", line 9, in <module>
 from marathon import MarathonClient, MarathonApp
ImportError: No module named marathon

The following steps will detail what you need to do in order to fix the rights to the files in question:

  1. Go to the folder containing all the Python packages (located in /home/blazemeter/virtualenv/lib/python2.7/site-packages/) and look for the module's folder(s) and/or file(s).

  2. For any folders attached to the module, the following command should be used to set the rights to 755 (read and execution access for all users): 

    chmod 755 <folder_name>

  3. For any files (scripts and configuration files), the following commands should be used to change the rights to 644 (read access to all users): 
    For script files:

    chmod 644 *.py * 

    For configuration and other files:

    chmod 644 * 

  4. Once all the folders and files had the correct rights, use the following commands to restart the opcd service: 

    supervisorctl stop opcd 
    supervisorctl start opcd


    service supervisord restart
Have more questions? Submit a request


Please sign in to leave a comment.