Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message when running model.SSA() and model.multiagent() #100

Closed
tbose1 opened this issue Jan 24, 2018 · 9 comments
Closed

Error message when running model.SSA() and model.multiagent() #100

tbose1 opened this issue Jan 24, 2018 · 9 comments
Assignees
Labels
Milestone

Comments

@tbose1
Copy link
Contributor

tbose1 commented Jan 24, 2018

AttributeError: 'Dropdown' object has no attribute 'layout'

I tried to update ipywidgets in the conda environment I'm using on my local machine but this caused updates of other packages as well due to dependencies which then disabled all widgets in the notebook. I downgraded to my previous version of ipywidgets again.

Currently I'm using ipywidgets=4.1.1 and notebook=4.1.0 package versions.

We should find a configuration that works for everyone.

@joefresna
Copy link
Contributor

My configuration is:

ipykernel                 4.6.1                    py35_0  
ipython                   4.2.0                    py35_1
ipywidgets                7.0.5                    py35_0    conda-forge
jupyter                   1.0.0                    py35_3
matplotlib                1.5.1               np111py35_0
notebook                  5.0.0                    py35_0 
widgetsnbextension        3.0.2                    py35_0

did you try
conda install -c conda-forge ipywidgets
?

and it can be enabled through:
jupyter nbextension enable --py --sys-prefix widgetsnbextension

@joefresna joefresna added this to the First release milestone Jan 29, 2018
@tbose1
Copy link
Contributor Author

tbose1 commented Jan 31, 2018

Today I tried several configurations in separate conda environments including python 3.5 and 3.6 versions. I also tried using exactly the package versions mentioned in the above comment.

I did not receive the error message anymore but now widgets are not displayed at all,
and the message I receive is:

"Failed to display Jupyter Widget of type FloatSlider.
If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean that the widgets JavaScript is still loading. If this message persists, it likely means that the widgets JavaScript library is either not installed or not enabled. See the Jupyter Widgets Documentation for setup instructions."

However, I did use the command:
jupyter nbextension enable --py --sys-prefix widgetsnbextension
and this was positively validated in the terminal.

So, unfortunately I'm still not able to run ssa and multiagent functions. Either it is a subtle package dependency that I haven't discovered yet or maybe something else. If someone has an idea, that would be helpful!

@tbose1
Copy link
Contributor Author

tbose1 commented Feb 1, 2018

Update:

I could now create a conda environment that works! If you want to use the same environment configuration here are the instructions (type in terminal):

  1. Create the environment with Python 3.5. Let's call it MumotEnv.
    conda create --name MumotEnv python=3.5

  2. activate this environment:
    source activate MumotEnv

  3. Install required packages for MuMoT in this environment (it is already activated in step 2., so packages will be installed in MumotEnv):
    conda install matplotlib sympy scipy networkx

  4. install ipywidgets:
    conda install -c conda-forge ipywidgets=7.0.5

  5. activate widget extensions in notebook (this is slightly different to the suggestion by @joefresna in one of the comments above, which hasn't worked for me):
    jupyter nbextension enable --py widgetsnbextension

  6. Install pydstool, graphviz, antlr with pip (again, these package will be installed in MumotEnv as it is still activated):
    pip install pydstool
    pip install graphviz
    pip install antlr4-python3-runtime==4.5.3

  7. downgrade to previous version of ipykernel:
    conda install ipykernel=4.6.1

This should hopefully work. To use Jupyter notebook in this environment:
If not already active, activate it with:
source activate MumotEnv

start Jupyter notebook as usual:
jupyter notebook

if you are finished you can deactivate it with:
source deactivate

FYI: If you don't activate this environment you will use your standard python configuration. So, if you create the environment as outlined above you do not modify your standard configuration, which is always available. Of course, you can choose a different environment name.

@jarmarshall
Copy link
Contributor

Great work Thomas - I think it should be possible to export this environment file from conda - this could be useful as it could be committed to the repository. Thoughts, @willfurnass ?

@tbose1
Copy link
Contributor Author

tbose1 commented Feb 1, 2018

Just committed the environment.yml file so that you can easily create the conda environment from file. See commit d15cf4b for details.

@willfurnass
Copy link
Collaborator

My preference would be to

  • restrict dependency versions in setup.py for those wanting to install mumot using pip (and eventually pypi when we go public)
  • separately create a conda build recipe and restrict run and/or build and/or test dependency versions in the meta.yaml for that recipe

although having a common environment.yml for helping inform our setup.py and meta.yaml is useful!

Re how conda upgrades/downgrades packages: have people specified channel priorities in their ~/.condarc files?

@jarmarshall
Copy link
Contributor

Will, I think you're best placed to update setup.py and meta.yaml and close this - for now the environment solution described in the readme seems to be doing the job for development purposes.

@willfurnass
Copy link
Collaborator

Could switch to using setup.py to define essential requirements (except LaTeX and graphviz) and we'd then have a single env for testing and deployment (local, Travis, Binder). Requires that #158 be resolved.

@willfurnass
Copy link
Collaborator

Addressed by #210

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants