Skip to content

FileNotFoundError: [Errno 2] No such file or directory: Code-Pro/.streamlit/secrets.toml' #2

Description

@spc789

Hi,

When installing Code-Pro locally with an .env file containing OPENAI_API_KEY= in the root of the project folder,
I get following error :

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
    exec(code, module.__dict__)
  File "/mnt/moredata/home/hdp/projects-crypto/selfGrid4/Code-Pro/main.py", line 17, in <module>
    openai.api_key = st.secrets["OPENAI_API_KEY"]
  File "/usr/local/lib/python3.8/dist-packages/streamlit/runtime/secrets.py", line 267, in __getitem__
    value = self._parse(True)[key]
  File "/usr/local/lib/python3.8/dist-packages/streamlit/runtime/secrets.py", line 174, in _parse
    with open(self._file_path, encoding="utf-8") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/mnt/moredata/home/<fullpath>/Code-Pro/.streamlit/secrets.toml'

It seems like there is no directory .streamlit in the project folder, do I have to make that dir myself and populate it with what ?
I have little experience with streamlit, how can this error be solved ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions