question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incompatibility with Dash v2.1.0

See original GitHub issue

Quick-Fix on User-Level

If you are a user and looking for a quick fix do this:

$ python -m pip uninstall dash
$ python -m pip install 'dash==2.0.0'

Cause

I spent the past 30 minutes diving through the source code of both projects and I would assume it has to do with: https://github.com/plotly/dash/pull/1876

Problem

Running the following lines always leads to the AttributeError below:

from jupyter_dash import JupyterDash
app = JupyterDash(__name__)
app.run_server(mode='inline')
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Input In [12], in <module>
      1 from jupyter_dash import JupyterDash
      2 app = JupyterDash()
----> 3 app.run_server(mode='inline')

File ~\.pyenv\pyenv-win\versions\3.10.2\lib\site-packages\jupyter_dash\jupyter_app.py:231, in JupyterDash.run_server(self, mode, width, height, inline_exceptions, **kwargs)
    229 else:
    230     requests_pathname_prefix = '/'
--> 231 self.config.update({'requests_pathname_prefix': requests_pathname_prefix})
    233 # Compute server_url url
    234 if self.server_url is None:

File ~\.pyenv\pyenv-win\versions\3.10.2\lib\site-packages\dash\_utils.py:169, in AttributeDict.update(self, other)
    166 def update(self, other):
    167     # Overrides dict.update() to use __setitem__ above
    168     for k, v in other.items():
--> 169         self[k] = v

File ~\.pyenv\pyenv-win\versions\3.10.2\lib\site-packages\dash\_utils.py:158, in AttributeDict.__setitem__(self, key, val)
    156 def __setitem__(self, key, val):
    157     if key in self.__dict__.get("_read_only", {}):
--> 158         raise AttributeError(self._read_only[key], key)
    160     final_msg = self.__dict__.get("_final")
    161     if final_msg and key not in self:

AttributeError: ('Read-only: can only be set in the Dash constructor or during init_app()', 'requests_pathname_prefix')

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:5
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
alexcjohnsoncommented, Feb 16, 2022

Fixed in v0.4.1

1reaction
alexcjohnsoncommented, Feb 11, 2022

Ha, JupyterDash was exploiting a loophole in the way Dash locked the parts of its config that it deems risky to set late - @t89 you’re correct that this is due to https://github.com/plotly/dash/pull/1876 where we closed the .update loophole.

We’re working on a fix for this - just need to figure out whether it’s better to continue working around the lock here, or if the fact that this is safe for JupyterDash means it’s safe for Dash.

In the meantime, add this before your app.run_server call and it’ll work with Dash 2.1:

del app.config._read_only["requests_pathname_prefix"]
Read more comments on GitHub >

github_iconTop Results From Across the Web

Dash 2.0 Prerelease Candidate Available!
We're excited to share that a Dash 2.0 Prerelease Candidate is now available. ... dash.dcc , dash.dash_table for backwards compatibility.
Read more >
What to do when pip dependency resolver wants to use ...
dash -bootstrap-components 1.0.3 requires dash>=2.0.0, but you have dash 1.10.0 which is incompatible. Any help is appreciated. Answer.
Read more >
Changelog - Dash Enterprise Administration
Introduces dash-snaphots v2.2.0 , v2.1.0 , v2.0.0 : dash-snapshots==2.2.0 : ... Added full compatibility with the Dash DAQ (Data AcQuisition) library.
Read more >
dash-core-components - PyPI
Notice. As of Dash 2, the development of dash-core-components has been moved to the main Dash repo. This package exists for backward compatibility...
Read more >
Mod compatibility - SMAPI.io
mod name links author broke in code 24h Clock Nexus Lajna SMAPI 3.0 source ( ) # PR 24‑Hour Clock Patcher Nexus pepoluan source # 24...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found