On streamlit cloud, my multipage app cannot import modules from the directory above. The error looks like:
File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/scriptrunner/script_runner.py", line 557, in _run_script
exec(code, module.__dict__)
File "app/home.py", line 5, in <module>
import lenders.elastic as elastic
ModuleNotFoundError: No module named 'lenders'
This ran fine on my local machine, which is weird.
Hello guys,
I have the exact same issue if try to run the app on the docker or locally. I am unable to import modules which lie outside of the streamlit app directory. But in pycharm if i setup the run configuration to include my source root it works the app is able to load and work. I have also tried adding the path into the config.toml in .streamlit folder under [server] config but still no luck
Any guidelines how to do for multi page app as the streamlit file doesn’t lie in the root directory. This is what my directory structure looks like. Please the streamlit_app is the directory for the app and I want to import functionlist as a module
It would be nice if the st.set_page_config command could include a hide_page parameter so that our functional .py files could lie inside the same directory.