Importing accessory pages linked to dropdown menu in sidebar

Hi -

I get a build error on the streamlit platform, it can’t find vis_helpers (my folder with accessory pages that are linked to the dropdown menu options). The import vis_helpers statement is in my streamlit_app.py header.

Much like the streamlit app that I am attempting to emulate, my accessory pages are in the right folder, and I have the right import statements in my streamlit_app.py. Below is my development code for streamlit_app.py, my current github does not have the code from below, but does have the accessory pages.

I need help so that I can get my streamlit app to recognize my accessory pages.

I am trying to emulate this app and adapt its github pages:
https://share.streamlit.io/czubert/sersitivis/vis.py

This is my streamlit app:
https://share.streamlit.io/retrosynthesisai/explore_app/main#visualization

This is my github repo:

Here is the development code from my streamlit_app:

“”"
Retrosynthesis AI - Explore App
Author: @Margaret Linan
Created: 12.21.21
Contributors: None
“”"

import streamlit as st
from PIL import Image
from stmol import component_3dmol
from pathlib import Path
import base64
from vis_helpers import main_page, mol3D, drugres, inutero, negtrop, zoodis

Initial page config

st.set_page_config(
page_title=‘Explore’,
layout=“wide”,
initial_sidebar_state=“expanded”,
)

def main():
cs_sidebar()

return None

def img_to_bytes(img_path):
img_bytes = Path(img_path).read_bytes()
encoded = base64.b64encode(img_bytes).decode()
return encoded

##########################

Sidebar

##########################
def cs_sidebar():
st.sidebar.title(‘Visualizations’)
analysis_type = st.sidebar.selectbox(“Selections”, [‘Main’, ‘Molecular 3D’, ‘Drug Resistant Diseases’, ‘In-Utero’, ‘Neglected Tropical Diseases’, ‘Zoonotic Diseases’])
if analysis_type == ‘Main’:
main_page.main()
if analysis_type == ‘Molecular 3D’:
mol3D.main()
elif analysis_type == ‘Drug Resistant Diseases’:
drugres.main()
elif analysis_type == ‘In-Utero’:
inutero.main()
elif analysis_type == ‘Neglected Tropical Diseases’:
negtrop.main()
elif analysis_type == ‘Zoonotic Diseases’:
zoodis.main()

if name == ‘main’:
main()

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