Filenotfound error under debug=True

Hi,

I’m running a very simple test program with the below code.

When running it under the main directory folder the app starts but under Debug=True I get the error at the bottom. When Debug=False it works fine.

Moreover if I move both app.py and mymodule.py into a subfolder it runs fine under Debug=True.

For some reason it tries to find a .cache folder and tries to access it in the folder of another project in the same directory (I ran some tests with cache in other apps but it’s clearly turned off for this run).

Why is that? Any help would be appreciated.

**app.py**
from mymodule import Table
from dash import Dash, html
import diskcache
app = Dash(__name__)
app.layout = Table(id='1')

if __name__ == "__main__":
    app.run_server(debug=True)
**mymodule.py**
from dash import DiskcacheManager, Dash, dcc, html, Input, Output, State
class Table(html.Div):
    def __init__(self, id: str):
        super().__init__([
            html.Div('hello')
        ])

Exception in thread Thread-1:
Traceback (most recent call last):
File “C:\Users\cklar\AppData\Local\Programs\Python\Python39\lib\threading.py”, line 954, in _bootstrap_inner
self.run()
File “C:\Users\cklar\AppData\Local\Programs\Python\Python39\lib\threading.py”, line 892, in run
self._target(*self._args, **self._kwargs)
File “E:\tcpR\streamlitdb\venv\lib\site-packages\dash\dash.py”, line 1674, in
target=lambda: _watch.watch(
File “E:\tcpR\streamlitdb\venv\lib\site-packages\dash_watch.py”, line 35, in watch
walk()
File “E:\tcpR\streamlitdb\venv\lib\site-packages\dash_watch.py”, line 20, in walk
info = os.stat(path)
FileNotFoundError: [WinError 3] The system cannot find the path specified: ‘E:\tcpR\streamlitdb\serversidetest\ag-grid-server-side-nodejs-example\node_modules\.cache\terser-webpack-plugin\content-v2\sha512\a3\9a\5ee199fbb14927ed17c5e8bfcd8fe6ef9f7db82da550c160b6b8e463703fa5ff8d5f4d6d8889ca239601b447fa63848661b56ea1f679935991d2f020cfe0’
Exception in thread Thread-1:
Traceback (most recent call last):
File “C:\Users\cklar\AppData\Local\Programs\Python\Python39\lib\threading.py”, line 954, in _bootstrap_inner
self.run()
File “C:\Users\cklar\AppData\Local\Programs\Python\Python39\lib\threading.py”, line 892, in run
self._target(*self._args, **self._kwargs)
File “E:\tcpR\streamlitdb\venv\lib\site-packages\dash\dash.py”, line 1674, in
target=lambda: _watch.watch(
File “E:\tcpR\streamlitdb\venv\lib\site-packages\dash_watch.py”, line 35, in watch
walk()
File “E:\tcpR\streamlitdb\venv\lib\site-packages\dash_watch.py”, line 20, in walk
info = os.stat(path)
FileNotFoundError: [WinError 3] The system cannot find the path specified: ‘E:\tcpR\streamlitdb\serversidetest\ag-grid-server-side-nodejs-example\node_modules\.cache\terser-webpack-plugin\content-v2\sha512\a3\9a\5ee199fbb14927ed17c5e8bfcd8fe6ef9f7db82da550c160b6b8e463703fa5ff8d5f4d6d8889ca239601b447fa63848661b56ea1f679935991d2f020cfe0’

Hi @spheredb,

I can’t replicate your error on my computer:

Python 3.10

  • dash 2.6.1
  • diskcache 5.4.0

The error is coming from the dash_watch.py file, which I don’t have in my Dash install. Is this coming from another package? What version of Dash are you using?

Hi 3d65 - thanks for the quick response.

I deleted the folder that seemed to cause the error (ag-grid-server-side-nodejs-example) and now it seems to run fine. So no idea - maybe the 2 projects had some issues with each other. Will let you know if the error comes back.

Thanks again!