Title: Cannot import matplotlib on Google App Engine dev appserver · Issue #1823 · matplotlib/matplotlib · GitHub
Open Graph Title: Cannot import matplotlib on Google App Engine dev appserver · Issue #1823 · matplotlib/matplotlib
X Title: Cannot import matplotlib on Google App Engine dev appserver · Issue #1823 · matplotlib/matplotlib
Description: Google App Engine is a restricted Python environment which now supports matplotlib on the production server (see Third-party Libraries), due to extensive modifications which Google made to the codebase to get it working. However, the dev...
Open Graph Description: Google App Engine is a restricted Python environment which now supports matplotlib on the production server (see Third-party Libraries), due to extensive modifications which Google made to the code...
X Description: Google App Engine is a restricted Python environment which now supports matplotlib on the production server (see Third-party Libraries), due to extensive modifications which Google made to the code...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/1823
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Cannot import matplotlib on Google App Engine dev appserver","articleBody":"Google App Engine is a restricted Python environment which now supports matplotlib on the production server (see [Third-party Libraries](https://developers.google.com/appengine/docs/python/tools/libraries27#matplotlib)), due to extensive modifications which Google made to the codebase to get it working. However, the [development server](https://developers.google.com/appengine/docs/python/tools/devserver) runs unmodified code for third-party libraries. The current version of Matplotlib (tested with 9690232 as of 14-03-2013) crashes if \"`import matplotlib`\" is run on the dev appserver:\n\n```\nTraceback (most recent call last):\n File \"/path/to/matplotlib/__init__.py\", line 846, in \u003cmodule\u003e\n rcParams = rc_params()\n File \"/path/to/matplotlib/__init__.py\", line 757, in rc_params\n fname = matplotlib_fname()\n File \"/path/to/matplotlib/__init__.py\", line 646, in matplotlib_fname\n home = get_home()\n File \"/path/to/matplotlib/__init__.py\", line 300, in wrapper\n ret = func(*args, **kwargs)\n File \"/path/to/matplotlib/__init__.py\", line 496, in _get_home\n raise RuntimeError('please define environment variable $HOME')\nRuntimeError: please define environment variable $HOME\n```\n\nThis is just one of the issues (fix that one, and more spring up). There are three major blockers:\n- Matplotlib expects the user to have a writable $HOME directory, so it will not work in any environment where the user does not have a home directory, or where there is a non-writable file system.\n- App Engine does provide a `subprocess` module, but it is empty. Therefore, any attempt to use `subprocess.Popen` on App Engine results in `AttributeError` being raised.\n- The `ps` backend writes to a temporary file, then reads it back in, even when not using an external distiller. This will not work in any environment where there is a non-writable file system.\n\nWe (the Google App Engine Python team) have patched these three issues to get Matplotlib working in our production environment. We propose sending these patches upstream so that Matplotlib will work out-of-the-box on App Engine and other restricted environments which ban file writing and use of subprocess.\n","author":{"url":"https://github.com/mgiuca-google","@type":"Person","name":"mgiuca-google"},"datePublished":"2013-03-15T01:16:03.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/1823/matplotlib/issues/1823"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:840d077b-d332-25de-79f1-2ada0cab4224 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A5A8:34DD25:17B234C:2017DE3:6A546D34 |
| html-safe-nonce | 5d197415cc8324bb83b591b6b8c8c2ddb08dc7ca5a6f15b0071b0c05f18689a6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNUE4OjM0REQyNToxN0IyMzRDOjIwMTdERTM6NkE1NDZEMzQiLCJ2aXNpdG9yX2lkIjoiNjk2MzM1MjM3MDUxMzQ3MjgyMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8326ce018ec86671cb33e00749988ee7b5aeaea634018d724a0db144e4389a4a |
| hovercard-subject-tag | issue:12046781 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/1823/issue_layout |
| twitter:image | https://opengraph.githubassets.com/68740fed04a5fc0db0f445cbf89d517751d0fbdbeaa232ad95ebd24f17a933b3/matplotlib/matplotlib/issues/1823 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/68740fed04a5fc0db0f445cbf89d517751d0fbdbeaa232ad95ebd24f17a933b3/matplotlib/matplotlib/issues/1823 |
| og:image:alt | Google App Engine is a restricted Python environment which now supports matplotlib on the production server (see Third-party Libraries), due to extensive modifications which Google made to the code... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mgiuca-google |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 6d28624802c2f7d9500239dd6870ed7031b7353b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width