Error with deployment.. Help!

Hi fellow Streamlit-ers!

I’m quite new to Streamlit and this whole deployment thing! I’ve just tried to create an app of a mini dashboard (work in progress).
When deployed I’ve seen this same error message littered across the community but I’m still a little lost on what to do!

This is what I get:

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/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 552, in _run_script
    exec(code, module.__dict__)

Any help would be much appreciated!

Github: GitHub - TennorBen/TennorDashboard
App: https://tennordashboard-nynqhzr4g6sdavptmc3jpz.streamlit.app/

Hi @TennorBen,

Thanks for posting!

Please share the full error log so we can help troubleshoot the issue.

Basically your requirements.txt contains some unnecessary or wrong packages and also some missing packages too. I will suggest to write this in your requirements.txt.

streamlit
pandas
numpy
geopy
Pillow
plotly
pydeck

@tonykip

Thanks for the replies! I modified the requirements with your suggested list and now I have a bunch more error messages! Here is the log:

2023-09-12 08:07:50.603 Uncaught app exception
Traceback (most recent call last):
  File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/caching/storage/in_memory_cache_storage_wrapper.py", line 87, in get
    entry_bytes = self._read_from_mem_cache(key)
  File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/caching/storage/in_memory_cache_storage_wrapper.py", line 137, in _read_from_mem_cache
    raise CacheStorageKeyNotFoundError("Key not found in mem cache")
streamlit.runtime.caching.storage.cache_storage_protocol.CacheStorageKeyNotFoundError: Key not found in mem cache

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/caching/cache_data_api.py", line 634, in read_result
    pickled_entry = self.storage.get(key)
  File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/caching/storage/in_memory_cache_storage_wrapper.py", line 89, in get
    entry_bytes = self._persist_storage.get(key)
  File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/caching/storage/local_disk_cache_storage.py", line 155, in get
    raise CacheStorageKeyNotFoundError(
streamlit.runtime.caching.storage.cache_storage_protocol.CacheStorageKeyNotFoundError: Local disk cache storage is disabled (persist=None)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/caching/cache_utils.py", line 263, in _get_or_create_cached_value
    cached_result = cache.read_result(value_key)
  File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/caching/cache_data_api.py", line 636, in read_result
    raise CacheKeyNotFoundError(str(e)) from e
streamlit.runtime.caching.cache_errors.CacheKeyNotFoundError: Local disk cache storage is disabled (persist=None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/caching/storage/in_memory_cache_storage_wrapper.py", line 87, in get
    entry_bytes = self._read_from_mem_cache(key)
  File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/caching/storage/in_memory_cache_storage_wrapper.py", line 137, in _read_from_mem_cache
    raise CacheStorageKeyNotFoundError("Key not found in mem cache")
streamlit.runtime.caching.storage.cache_storage_protocol.CacheStorageKeyNotFoundError: Key not found in mem cache

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/caching/cache_data_api.py", line 634, in read_result
    pickled_entry = self.storage.get(key)
  File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/caching/storage/in_memory_cache_storage_wrapper.py", line 89, in get
    entry_bytes = self._persist_storage.get(key)
  File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/caching/storage/local_disk_cache_storage.py", line 155, in get
    raise CacheStorageKeyNotFoundError(
streamlit.runtime.caching.storage.cache_storage_protocol.CacheStorageKeyNotFoundError: Local disk cache storage is disabled (persist=None)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/caching/cache_utils.py", line 311, in _handle_cache_miss
    cached_result = cache.read_result(value_key)
  File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/caching/cache_data_api.py", line 636, in read_result
    raise CacheKeyNotFoundError(str(e)) from e
streamlit.runtime.caching.cache_errors.CacheKeyNotFoundError: Local disk cache storage is disabled (persist=None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 552, in _run_script
    exec(code, module.__dict__)
  File "/mount/src/tennordashboard/hello.py", line 19, in <module>
    df = getData("C:/Users/Ben.Jones/TestData.xlsx")
  File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/caching/cache_utils.py", line 211, in wrapper
    return cached_func(*args, **kwargs)
  File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/caching/cache_utils.py", line 240, in __call__
    return self._get_or_create_cached_value(args, kwargs)
  File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/caching/cache_utils.py", line 266, in _get_or_create_cached_value
    return self._handle_cache_miss(cache, value_key, func_args, func_kwargs)
  File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/caching/cache_utils.py", line 320, in _handle_cache_miss
    computed_value = self._info.func(*func_args, **func_kwargs)
  File "/mount/src/tennordashboard/hello.py", line 16, in getData
    data = pd.read_excel(excelPath)
  File "/home/adminuser/venv/lib/python3.9/site-packages/pandas/io/excel/_base.py", line 504, in read_excel
    io = ExcelFile(
  File "/home/adminuser/venv/lib/python3.9/site-packages/pandas/io/excel/_base.py", line 1563, in __init__
    ext = inspect_excel_format(
  File "/home/adminuser/venv/lib/python3.9/site-packages/pandas/io/excel/_base.py", line 1419, in inspect_excel_format
    with get_handle(
  File "/home/adminuser/venv/lib/python3.9/site-packages/pandas/io/common.py", line 872, in get_handle
    handle = open(handle, ioargs.mode)
FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/Ben.Jones/TestData.xlsx'

Help!

You don’t have access to the clients filesystem if your streamlit app runs on any hosted environment.

Thanks for the reply @Franky1.

Sorry to be a pain, but could you explain this to me in simpler terms? (I’m clueless)

Is there a way around this?

Put the files you need in your folder and under git control and for example just do:

df = getData("TestData.xlsx")

This will work both local and on streamlit cloud.
Don’t use absolute paths from your local filesystem.

@Franky1 Makes much more sense, thanks!

I’ve edited my data import with that change but still run into errors.

If I have any kind of absolute paths with it break my code/app?

I still see file paths to your local filesystem, this will not work.

@Franky1 I think I’ve removed or commented out every absolute file path there is! Have no idea why it isn’t working anymore.

Sorry to be a pain, but I massively appreciate the patience and help here.

If anyone else out there has any suggestions I would massively appreciate the help!

It seems to have worked now, thanks all!

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