Search code examples
pythongoogle-colaboratoryplotly-dashattributeerror

What I get an attribute error from plotly-dash in PYTHON?


Here You can see a Colab code. I basically try to run those codes but I get this error.

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-16-1b48c937269f> in <module>()
----> 1 macrodemos.ARMA()

3 frames
/usr/local/lib/python3.7/dist-packages/dash/_utils.py in __setitem__(self, key, val)
    156 
    157     # pylint: disable=inconsistent-return-statements
--> 158     def first(self, *names):
    159         for name in names:
    160             value = self.get(name)

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

I have no idea about this actually and I am not an expert. Could you please explain the problem? and a solution if you have any. Thanks


Solution

  • It appears there is some issue with the latest version of the package. Using the following version of the packages appears to work well.

    Notebook with changes, for your convenience:

    https://colab.research.google.com/drive/1WyPr2p2nXmrNhjqJXl7hKaHtOocP731S?usp=sharing

    Explanation: While installing the packages, simple use:

    !pip install macrodemos --upgrade
    !pip install -q dash==1.19.0
    

    This will replace the version of dash used to an older one that works, Here is a screenshot for your reference:

    Screenshot 1

    I am a newbie and I appreciate your feedback about whether this is helpful or not. Thanks in advance. :)