Dash does not work anymore

Hi guys, recently I updated some of my python modules including Dash. When I try to run my Dash App I get the following error:

app = dash.Dash(__name__)

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/code.py", line 90, in runcode
    exec(code, self.locals)
  File "<input>", line 1, in <module>
  File "/Users/v/Documents/Py/venv/lib/python3.8/site-packages/dash/dash.py", line 287, in __init__
    self.server = flask.Flask(name) if server else None
  File "/Users/v/Documents/Py/venv/lib/python3.8/site-packages/flask/app.py", line 409, in __init__
    instance_path = self.auto_find_instance_path()
  File "/Users/v/Documents/Py/venv/lib/python3.8/site-packages/flask/app.py", line 641, in auto_find_instance_path
    prefix, package_path = find_package(self.import_name)
  File "/Users/v/Documents/Py/venv/lib/python3.8/site-packages/flask/scaffold.py", line 839, in find_package
    package_path = _find_package_path(root_mod_name)
  File "/Users/v/Documents/Py/venv/lib/python3.8/site-packages/flask/scaffold.py", line 790, in _find_package_path
    return os.path.dirname(next(iter(spec.submodule_search_locations)))
TypeError: 'NoneType' object is not iterable

Can anyone help?

If further details are necessary I am happy to elaborate.

Hi Peter,
First, do you mind uploading all of your code?
Second, did you try pip uninstall dash and installing it again?

Hi @Matan,

this is my code:

import dash

app = dash.Dash(__name__)

I deleted my complete virtual environment and then installed all modules from scratch.

Are you by any chance using Pycharm…?

@jlfsjunior, haha yes I am. Ended up uninstalling absolutely everything and then reinstalled it. Now it works. Can you elaborate what was the problem?

@HansPeter123 I had a hunch that this could be an IDE problem, so I googled the last part of your traceback and found some issues in Pycharm related to that.

I don’t use pycharm anyomore for some years, no idea what is the problem there…