From edbd796e8ebc30d453dbcc0e80090edccf231456 Mon Sep 17 00:00:00 2001 From: dpryan79 Date: Tue, 6 Mar 2018 15:33:35 +0100 Subject: [PATCH] Don't crash if figure_factory is imported but pandas isn't installed. Fixes #941 --- plotly/figure_factory/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plotly/figure_factory/__init__.py b/plotly/figure_factory/__init__.py index 9bf00cbcf2..a8be19872e 100644 --- a/plotly/figure_factory/__init__.py +++ b/plotly/figure_factory/__init__.py @@ -1,5 +1,7 @@ from __future__ import absolute_import +from plotly import optional_imports + # Require that numpy exists for figure_factory import numpy @@ -18,4 +20,5 @@ from plotly.figure_factory._table import create_table from plotly.figure_factory._trisurf import create_trisurf from plotly.figure_factory._violin import create_violin -from plotly.figure_factory._county_choropleth import create_choropleth \ No newline at end of file +if optional_imports.get_module('pandas') is not None: + from plotly.figure_factory._county_choropleth import create_choropleth