1

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

2 Answers 2

2

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. :)

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you so much. It works better than the original one :) I tried the same stuff but I failed somehow. I really appreciate your effort and time. Have a nice day.
2

I was able to fix this error by following the recommendations in the error message pasted here for reference,

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

The solution is to only set the Dash config when you first initialize the app application instead of using app.config.update according to the new version of Dash.

So instead of something like this which is trying to update a read-only variable,

app.config.update({
    'requests_pathname_prefix': '/dash/' # wrong, will cause read-only error
})

You could do,

app = dash.Dash(
    :
    requests_pathname_prefix='/dash/')

Which sets those variables when it originally was defined so there will be no read-only error.

This answer might not fully address the original poster's concerns because after looking at the Colab notebook, the library of concern is macrodemos which needs to be updated to be compatible with the newest version of Dash.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.