diff --git a/plotly/graph_reference.py b/plotly/graph_reference.py index a9ae8df067e..9ac39a76f21 100644 --- a/plotly/graph_reference.py +++ b/plotly/graph_reference.py @@ -6,7 +6,7 @@ import os import re -from pkg_resources import resource_string +import pkgutil import six from requests.compat import json as _json @@ -69,7 +69,7 @@ def get_graph_reference(): """ path = os.path.join('package_data', 'plot-schema.json') - s = resource_string('plotly', path).decode('utf-8') + s = pkgutil.get_data('plotly', path).decode('utf-8') graph_reference = utils.decode_unicode(_json.loads(s)) # TODO: Patch in frames info until it hits streambed. See #659 diff --git a/plotly/offline/offline.py b/plotly/offline/offline.py index 1ba236596a9..2a8876ad5c6 100644 --- a/plotly/offline/offline.py +++ b/plotly/offline/offline.py @@ -8,7 +8,7 @@ import os import uuid import warnings -from pkg_resources import resource_string +import pkgutil import time import webbrowser @@ -38,7 +38,7 @@ def download_plotlyjs(download_url): def get_plotlyjs(): path = os.path.join('package_data', 'plotly.min.js') - plotlyjs = resource_string('plotly', path).decode('utf-8') + plotlyjs = pkgutil.get_data('plotly', path).decode('utf-8') return plotlyjs def get_image_download_script(caller): diff --git a/plotly/tests/test_core/test_graph_reference/test_graph_reference.py b/plotly/tests/test_core/test_graph_reference/test_graph_reference.py index f81cc79e9f2..13d3083a3b4 100644 --- a/plotly/tests/test_core/test_graph_reference/test_graph_reference.py +++ b/plotly/tests/test_core/test_graph_reference/test_graph_reference.py @@ -5,7 +5,6 @@ from __future__ import absolute_import import os -from pkg_resources import resource_string from unittest import TestCase from nose.plugins.attrib import attr diff --git a/plotly/widgets/graph_widget.py b/plotly/widgets/graph_widget.py index 451adf223bd..d514c63a18b 100644 --- a/plotly/widgets/graph_widget.py +++ b/plotly/widgets/graph_widget.py @@ -4,7 +4,7 @@ """ import uuid from collections import deque -from pkg_resources import resource_string +import pkgutil from requests.compat import json as _json @@ -20,8 +20,9 @@ # Load JS widget code # No officially recommended way to do this in any other way # http://mail.scipy.org/pipermail/ipython-dev/2014-April/013835.html -js_widget_code = resource_string('plotly', - 'package_data/graphWidget.js').decode('utf-8') +js_widget_code = pkgutil.get_data('plotly', + 'package_data/graphWidget.js' + ).decode('utf-8') display(Javascript(js_widget_code))