ModuleNotFoundError:

I have this problem, I couldn’t solve it.

ModuleNotFoundError: This app has encountered an error. The original error message is redacted to prevent data leaks. Full error details have been recorded in the logs (if you’re on Streamlit Cloud, click on ‘Manage app’ in the lower right of your app).

Traceback:

```
File “/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py”, line 556, in _run_script

  • exec(code, module.dict)File “/app/consultaacoes/app.py”, line 2, in *
  • import yfinance as yf*
    ```
[11:12:33] 📦 Processed dependencies!



2022-09-02 11:13:40.181 Uncaught app exception
Traceback (most recent call last):
  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 556, in _run_script
    exec(code, module.__dict__)
  File "/app/consultaacoes/app.py", line 2, in <module>
    import yfinance as yf
ModuleNotFoundError: No module named 'yfinance'
2022-09-02 11:24:57.894 Uncaught app exception
Traceback (most recent call last):
  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 556, in _run_script
    exec(code, module.__dict__)
  File "/app/consultaacoes/app.py", line 2, in <module>
    import yfinance as yf
ModuleNotFoundError: No module named 'yfinance'
2022-09-02 11:43:40.973 Uncaught app exception
Traceback (most recent call last):
  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 556, in _run_script
    exec(code, module.__dict__)
  File "/app/consultaacoes/app.py", line 2, in <module>
    import yfinance as yf
ModuleNotFoundError: No module named 'yfinance'
2022-09-02 11:54:58.792 Uncaught app exception
Traceback (most recent call last):
  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 556, in _run_script
    exec(code, module.__dict__)
  File "/app/consultaacoes/app.py", line 2, in <module>
    import yfinance as yf
ModuleNotFoundError: No module named 'yfinance'

Hi @Diogo_Moura,

Thanks for posting!

Can you share your requirements file?

Caroline :balloon:

1 Like

Thanks!
How can I share this file?

image

Diogo,

Hi @Diogo_Moura,

You can just copy/paste the contents here, thanks!

Caroline :balloon:

Hi @Caroline,

I started my journey a little while ago.
I created the requirements file but could not perform the procedure for entering information into it. I would be very grateful if I could help with anything.


Diogo,

Hey @Diogo_Moura

In the requirements.txt file, you have to list all the dependencies (libraries) that your app is using so that it can be installed on the cloud when you deploy your app.

For eg, you can add yfinance to it.

Thanks
Kanak

2 Likes

FileNotFoundError: This app has encountered an error. The original error message is redacted to prevent data leaks. Full error details have been recorded in the logs (if you’re on Streamlit Cloud, click on ‘Manage app’ in the lower right of your app).

 File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 563, in _run_script
    exec(code, module.__dict__)
  File "/app/cyclone-project/archive/cyclone_project_pynb.py", line 70, in <module>
    with open("insat_3d_ds - Sheet.csv",'r') as csv_file:
FileNotFoundError: [Errno 2] No such file or directory: 'insat_3d_ds - Sheet.csv'


getting same error

Hi @Aryan_Srivastava, do you have a requirements.txt with moviepy in it? If that doesn’t work, could you share a link to your repo?


getting this error ,could not solve it ,please help

Hi @Ibad_Laskar,

Could you please provide us with the full error log trace?

Thanks,
Charly


this is the error ,when ever i send request to my backend flak app

.

this is my github repo for this app

Thanks @Ibad_Laskar

Do you have a text version of the error trace?

Charly

The error message leads me to believe that you are not getting a response from your backend.

Ok, so the error shown in your screenshot is a JSONDecodeError, which typically occurs when attempting to decode an invalid JSON string.

You should ensure that the JSON string isn’t empty before attempting to parse it with json.loads(). Below’s one approach to check this:

import requests

try:
    response = requests.get('your-api-url')
    if response.ok:
        data = response.json()
    else:
        print("Error fetching data:", response.status_code)
except json.JSONDecodeError:
    print("Failed to decode JSON")
except requests.RequestException as e:
    print("HTTP request failed:", e)

Let me know if you need further assistance.

Best,
Charly

1 Like