diff --git a/server/cli/launch.py b/server/cli/launch.py index ca5c59f7..7523e497 100644 --- a/server/cli/launch.py +++ b/server/cli/launch.py @@ -82,6 +82,10 @@ def launch(data, layout, diffexp, title, verbose, debug, obs_names, var_names, click.echo(f"[cellxgene] Loading data from {basename(data)}, this may take awhile...") + # Fix for anaconda python. matplotlib typically expects python to be installed as a framework TKAgg is usually + # available and fixes this issue. See https://matplotlib.org/faq/virtualenv_faq.html + import matplotlib as mpl + mpl.use('TkAgg') from server.app.scanpy_engine.scanpy_engine import ScanpyEngine args = { diff --git a/server/requirements.txt b/server/requirements.txt index 27302b21..97c07954 100644 --- a/server/requirements.txt +++ b/server/requirements.txt @@ -6,6 +6,7 @@ Flask-Compress>=1.4.0 Flask-Cors>=3.0.6 Flask-RESTful>=0.3.6 flask-restful-swagger-2>=0.35 +matplotlib>=2.2 numpy>=1.14.5 pandas>=0.23.1 scanpy>=1.3.2