ERROR when deploying app with Stream-select-menu

Hi, i want to deploy my streamlite app but I’ve ran into a problem with the select-menu. It worked all fine when I wrote and tested the app and once I deployed the app it says ERROR: Module Object not callable. I have already checked my requirements.txt and updated it but something is still not working.
here is my code: strength-training-documentation-and-analysis-app/app.py at main · Michel-99/strength-training-documentation-and-analysis-app · GitHub

Hey @Michel-99,

Regarding streamlit_option_menu, instead of :

import streamlit_option_menu as option_menu

You should import option_menu like the following:

from streamlit_option_menu import option_menu

Let us know if that helped.

perfect, thank you so much. It works now, I made a mistake when I copied the code to github.

This error occurs when the python compiler gets confused between function name and module name and try to run a module name as a function. This error statement TypeError: ‘module’ object is not callable is raised as you are being confused about the Class name and Module name. The problem is in the import line . You are importing a module, not a class. This happend because the module name and class name have the same name .

If you have a class MyClass in a file called MyClass.py , then you should write:

from MyClass import MyClass

In Python , a script is a module, whose name is determined by the filename . So when you start out your file MyClass.py with import MyClass you are creating a loop in the module structure. Also, note that this usually happens when you import any kind of module as a function.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.