Unable to find file with st.link()

Please take a moment to search the forum and documentation before posting a new topic.
If you’re creating a debugging post, please include the following info:

  1. Are you running your app locally or is it deployed?
  2. If your app is deployed:
    a. Is it deployed on Community Cloud or another hosting platform?
    b. Share the link to the public deployed app.
  3. Share the link to your app’s public GitHub repository (including a requirements file).
  4. Share the full text of the error message (not a screenshot).
  5. Share the Streamlit and Python versions.

I am using pycharm 2025.1.3.1
windows 11
python 3.12

with st.sidebar:
st.title(“Home”)
st.write(“”)
st.write(“”)
st.subheader(“Products”)
st.page_link(
“/Product/Products.py”,
label=“Products”,
icon=“:material/emoji_transportation:”
)

st.page_link() I am trying to link to a Products.py. I have changed the directory from the full windows directory to just the project directory .venv/Product/Products.py and multiple longer and shorter possible combinations. I have attached a picture of the project structure:

No Matter what I put in the link to product.py I get the following:
‘’
StreamlitPageNotFoundError: Could not find page: /Product/Products.py. You must
provide a file path relative to the entrypoint file (from the directory .venv). Only
the entrypoint file and files in the pages/ directory are supported.
‘’

What am I missing. I assume the main.py file is the entry and resides in the .venv directory one up from pages. I have moved the main.py to the /pages directory and others both higher and lower.

I have no spent multiple hours so I am hoping the community can see forgive my stupidity, as I am sure this is a simple fix, and tell me what I am missing.

Thank you

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