My app need to source data from postgresql, however when I launched the app, I got the following errors:
Traceback (most recent call last):
File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 541, in _run_script
exec(code, module.__dict__)
File "/mount/src/aisreport/interface.py", line 4, in <module>
conn = st.experimental_connection("postgresql", type="sql")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/connection_factory.py", line 298, in connection_factory
raise ModuleNotFoundError(f"{str(e)}. {extra_info}")
ModuleNotFoundError: No module named 'sqlalchemy'. You need to install the 'sqlalchemy' package to use this connection.
Although in my requirements.txt file, I already included the sqlalchemy. These are my links:
Hi @Charly_Wargnier
In my local app, it works well if it’s the exact same prompt (without connecting to postgresql). Once I use the previous code that I used in my repository, it encountered another error of not finding the secrets file path.
By the way, as a best practice, you should keep your secret info out of your GitHub repository. Be sure to add your secrets.toml file to your .gitignore so you don’t accidentally commit them.