Skip to content

Fix Matplotlib crash on OS X#190

Merged
tvst merged 8 commits intostreamlit:developfrom
tconkling:tim/MatplotlibCrash
Sep 27, 2019
Merged

Fix Matplotlib crash on OS X#190
tvst merged 8 commits intostreamlit:developfrom
tconkling:tim/MatplotlibCrash

Conversation

@tconkling
Copy link
Copy Markdown
Contributor

Fixes #177, but in a way that makes @tvst sad :)

I wrote longer notes in the issue (#177) about what needs to happen to avoid importing matplotlib here - but the tl;dr is that bootstrap.run is called after matplotlib is indirectly imported elsewhere. Since matplotlib only reads MPLBACKEND on import, bootstrap gets there too late to have its environment variable override have any effect.

@tconkling tconkling requested review from arraydude and tvst September 25, 2019 23:26
@tvst tvst force-pushed the tim/MatplotlibCrash branch from 3f2981f to 4c6bcf2 Compare September 27, 2019 00:32
@tvst
Copy link
Copy Markdown
Contributor

tvst commented Sep 27, 2019

Merging. There's 1 e2e test failure that is unrelated to this PR, and for which @arraydude has a fix.

@tvst tvst merged commit 4bf7e68 into streamlit:develop Sep 27, 2019
tvst pushed a commit to tvst/streamlit that referenced this pull request Sep 29, 2019
* Fix matplotlib

* Test

* Add matplotlib to dev Pipfile since our unit tests now depend on it.

* Make Python-2.7.16 lockfile install matplotlib.

* no-op

* Fix MPLBACKEND in "base" integration tests

* Only set matplotlib backend on darwin.

* Fix bootstrap_test.py
tvst added a commit that referenced this pull request Sep 29, 2019
…eral. (#209)

* Visual pass on sidebar (including toggle for mobile)

* Update doc in server.port to mention liveSave.

* Update bootstrap alert boxes

* Improve sidebar icons.

* Update .info color

* Fix Matplotlib crash on OS X (#190)

* Fix matplotlib

* Test

* Add matplotlib to dev Pipfile since our unit tests now depend on it.

* Make Python-2.7.16 lockfile install matplotlib.

* no-op

* Fix MPLBACKEND in "base" integration tests

* Only set matplotlib backend on darwin.

* Fix bootstrap_test.py

* Reset Widget State (#45)

* A solution

* Button, Checkbox, Radio, TextInput

* Selectbox

* TextArea

* Time Input

* Date Input

* Slider

* Make ESLint happy

* Make pytest happy

* Solution using React keys

* Copypasta

* Better description of widget id

* Disable multiselect default value for now

* Resolve merge conflicts

* Fix DeltaGenerator

* Remove rws example

* RWS using _do_widget_boilerplate

* Refactor _do_widget_boilerplate

* Fix ScriptRunner tests

* Resolve merge conflicts

* Forgot to clean the log

* Now it works

* Fix #173 - ChunkLoadError alert (#192)

* ChunkLoadError alert

* Adding F5 to the message

* Adding F5 to the message

* New error message

* Delete vega_lite_chart snapshot

* Creating vega_lite_chart snapshot

* add_rows compatibility with python 2 and unit tests (#202)

* add_rows compatibility with python 2 and unit tests

* dataframe_visuals snapshot

* Multiselect default value (#201)

* initial code

* linter

* unit tests

* linter

* removing unused code

* e2e wip

* use strings in default

* darwin snapshot and test update

* linux snapshots

* comparing to string type in a way python2 likes

* new snapshot

* new snapshots

* trying to fix e2e test

* trying to fix e2e test agaon

* Remove unnecessary wrapper classed "streamlit-container"

* Fix bug where widgets caused scripts to run twice

* Fix e2e tests since reports have different width now

* Add missing snapshots

* Make altair a prod dependency

* Update screenshots

* Fix run_e2e_tests.sh
tvst added a commit to tvst/streamlit that referenced this pull request Sep 30, 2019
…eral. (streamlit#209)

* Visual pass on sidebar (including toggle for mobile)

* Update doc in server.port to mention liveSave.

* Update bootstrap alert boxes

* Improve sidebar icons.

* Update .info color

* Fix Matplotlib crash on OS X (streamlit#190)

* Fix matplotlib

* Test

* Add matplotlib to dev Pipfile since our unit tests now depend on it.

* Make Python-2.7.16 lockfile install matplotlib.

* no-op

* Fix MPLBACKEND in "base" integration tests

* Only set matplotlib backend on darwin.

* Fix bootstrap_test.py

* Reset Widget State (#45)

* A solution

* Button, Checkbox, Radio, TextInput

* Selectbox

* TextArea

* Time Input

* Date Input

* Slider

* Make ESLint happy

* Make pytest happy

* Solution using React keys

* Copypasta

* Better description of widget id

* Disable multiselect default value for now

* Resolve merge conflicts

* Fix DeltaGenerator

* Remove rws example

* RWS using _do_widget_boilerplate

* Refactor _do_widget_boilerplate

* Fix ScriptRunner tests

* Resolve merge conflicts

* Forgot to clean the log

* Now it works

* Fix streamlit#173 - ChunkLoadError alert (streamlit#192)

* ChunkLoadError alert

* Adding F5 to the message

* Adding F5 to the message

* New error message

* Delete vega_lite_chart snapshot

* Creating vega_lite_chart snapshot

* add_rows compatibility with python 2 and unit tests (streamlit#202)

* add_rows compatibility with python 2 and unit tests

* dataframe_visuals snapshot

* Multiselect default value (streamlit#201)

* initial code

* linter

* unit tests

* linter

* removing unused code

* e2e wip

* use strings in default

* darwin snapshot and test update

* linux snapshots

* comparing to string type in a way python2 likes

* new snapshot

* new snapshots

* trying to fix e2e test

* trying to fix e2e test agaon

* Remove unnecessary wrapper classed "streamlit-container"

* Fix bug where widgets caused scripts to run twice

* Fix e2e tests since reports have different width now

* Add missing snapshots

* Make altair a prod dependency

* Update screenshots

* Fix run_e2e_tests.sh
@tconkling tconkling deleted the tim/MatplotlibCrash branch October 1, 2019 15:20
tvst added a commit that referenced this pull request Oct 3, 2019
* Restore correct vertical spacing for report elements.

* Break Block.tsx into more functions.

* Tiny refactors in Block.tsx

* Add "key" property to element in DocString, to avoid warnings.

* Fix #1230: OSError not caught when writing cache to disk

* Don't show hashing warning when user imports a module inside a cached function.

* Fix #6: report should loads element by element (was broken since Sidebar PR)

* Try to fix CircleCI issue: Method 'renderElementWithErrorBoundary' expected no return value

* Add typing to function.

* Remove unecessary dockerfiles

* Fix a bunch of examples

* Fix color of syntax error code in modal dialog.

* Remove old style copyright from conftest.py

* Remove st.warning when hashing a class.

* Add astor to Python requirements

* Update widget API in some e2e tests

* Clean up st.foo_widget() signatures in st.help()

* Lint docs/getting_started.md

* Clean up widget examples in docstrings.

* Add comment to slider examples in docs.

* Tweak Streamlit's description in setup.py

* Sort pipfile modules

* Re-add scripts and Makefile rules to publish packages to conda.

* Fix update_version.py to support new conda location and remove old docker folder.

* Make `streamlit config show` pipeable to a file.

* Update docs/ site

* Remove /docs/api invalidation from Makefile

* Improve docstring for st.slider

* Remove st.Cache (capital C) from __init__ while we figure out what to call it.

* Up version to 0.45.0

* Turn off tests for st.Cache (capital C)

* Try turning off tests again

* [docs] Add analytics; redirect /secret/docs; fix compilation problem (#149)

* Restore correct vertical spacing for report elements.

* Break Block.tsx into more functions.

* Tiny refactors in Block.tsx

* Add "key" property to element in DocString, to avoid warnings.

* Fix #1230: OSError not caught when writing cache to disk

* Don't show hashing warning when user imports a module inside a cached function.

* Fix #6: report should loads element by element (was broken since Sidebar PR)

* Try to fix CircleCI issue: Method 'renderElementWithErrorBoundary' expected no return value

* Add typing to function.

* Remove unecessary dockerfiles

* Fix a bunch of examples

* Fix color of syntax error code in modal dialog.

* Remove old style copyright from conftest.py

* Remove st.warning when hashing a class.

* Add astor to Python requirements

* Update widget API in some e2e tests

* Clean up st.foo_widget() signatures in st.help()

* Lint docs/getting_started.md

* Clean up widget examples in docstrings.

* Add comment to slider examples in docs.

* Tweak Streamlit's description in setup.py

* Sort pipfile modules

* Re-add scripts and Makefile rules to publish packages to conda.

* Fix update_version.py to support new conda location and remove old docker folder.

* Make `streamlit config show` pipeable to a file.

* Update docs/ site

* Remove /docs/api invalidation from Makefile

* Improve docstring for st.slider

* Remove st.Cache (capital C) from __init__ while we figure out what to call it.

* Up version to 0.45.0

* Turn off tests for st.Cache (capital C)

* Try turning off tests again

* Publish docs to both /docs and /secret/docs, until we deprecate /secret/docs in January.

* Improve docs site: add analytics, redirect from secret/docs/, fix DeltaGenerator docs bug

* Fix publish-docs in Makefile

* Fix hashing error message that printed as a tuple.

Also made other error messages use textwrap.dedent for clarity.

* Hide legend from native charts when data has only 1 column.

* Beautify sidebar, make it usable on mobile, and improve colors in general. (#209)

* Visual pass on sidebar (including toggle for mobile)

* Update doc in server.port to mention liveSave.

* Update bootstrap alert boxes

* Improve sidebar icons.

* Update .info color

* Fix Matplotlib crash on OS X (#190)

* Fix matplotlib

* Test

* Add matplotlib to dev Pipfile since our unit tests now depend on it.

* Make Python-2.7.16 lockfile install matplotlib.

* no-op

* Fix MPLBACKEND in "base" integration tests

* Only set matplotlib backend on darwin.

* Fix bootstrap_test.py

* Reset Widget State (#45)

* A solution

* Button, Checkbox, Radio, TextInput

* Selectbox

* TextArea

* Time Input

* Date Input

* Slider

* Make ESLint happy

* Make pytest happy

* Solution using React keys

* Copypasta

* Better description of widget id

* Disable multiselect default value for now

* Resolve merge conflicts

* Fix DeltaGenerator

* Remove rws example

* RWS using _do_widget_boilerplate

* Refactor _do_widget_boilerplate

* Fix ScriptRunner tests

* Resolve merge conflicts

* Forgot to clean the log

* Now it works

* Fix #173 - ChunkLoadError alert (#192)

* ChunkLoadError alert

* Adding F5 to the message

* Adding F5 to the message

* New error message

* Delete vega_lite_chart snapshot

* Creating vega_lite_chart snapshot

* add_rows compatibility with python 2 and unit tests (#202)

* add_rows compatibility with python 2 and unit tests

* dataframe_visuals snapshot

* Multiselect default value (#201)

* initial code

* linter

* unit tests

* linter

* removing unused code

* e2e wip

* use strings in default

* darwin snapshot and test update

* linux snapshots

* comparing to string type in a way python2 likes

* new snapshot

* new snapshots

* trying to fix e2e test

* trying to fix e2e test agaon

* Remove unnecessary wrapper classed "streamlit-container"

* Fix bug where widgets caused scripts to run twice

* Fix e2e tests since reports have different width now

* Add missing snapshots

* Make altair a prod dependency

* Update screenshots

* Fix run_e2e_tests.sh

* Improve hello.py

* Unset bootstrap styles for styletron.

* Improve progress bar CSS in sidebar

* Support line_chart add_rows with non-Range index

* Improve a couple examples/

* Improve titles of error dialogs in App.js

* Make "make with Streamlit" a little lighter.

* Fix add_rows crash

* Improve hello.py text

* Make <pre> in <alert> have transparent background

* Fix empty dataframe breakage, introduced with aa0dd56

* Update markdown e2e test to make it less flaky

* Fix refenrence.py add_rows.

* Fix scrollability with arrow keys.

* Version 0.47.0

* Small hello.py tweaks

* Make hello.py work with emojis in Py2

* Update snapshots.

* Fix z-index of Vega Lite FAB

* Fix add_rows bug in JS, when orig line_chart as empty

* Replace add_rows assert with exception

* Make pop-up menu text darker in user widgets

* Fix add_rows test

* Update NOTICES

* Update snapshots

* Improve documentation for Streamlit launch (#197)

* Simplification of the get started materials.

* Fixed RST link in the GSG. There are still two placeholder links in that doc. Also, added mock for the advanced concepts. Still incomplete. Will fill in content based on what Amanda sends over.

* Removing list of text commands from the get started guide. Updating advanced concepts

* Fixing index toc.

* Changing from interactive app to data explorer app.

* Adding the link to GitHub.

* Addressing comments from @jrhone.

* Updating text on GSG page.

* Adding sidebar to GSG.

* Adding main concepts. Removing core mechanics. Fixing links.

* Fixing broken anchor links. Adding updated image from TC.

* Updated image from TC.

* Increase version-check probability to 10%

* Fix Vega-Lite cropped bottom axis bug.

* Set minimum altair version in Pipfile so we can pass numpy arrays to line_chart.

* Improve docs

* Version 0.47.1

* Fix link in docs.

* Add YouTube video to docs.

* Fix #222: import urllib in hello.py

* Version 0.47.2

* [docs] Update changelog, add py2 warning about magic, remove conda, fix links

* [docs] Remove outdated reference to old streamlit hello

* [docs] Fix "getting_stated" code about progress()

* Add forgotten item to changelog.

* Fix Vega Lite tests

* Update snapshots
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

matplotlib.pyplot crash on OSX

2 participants