import plotly
from pyuvvis.plotting.plotlywrapper import figure
However, if instead I had not imported plotly directly, I get an error (full traceback below):
from pyuvvis.plotting.plotlywrapper import figure
I am using enthought canopy as my primary python environment. We are using the most up-to-date version of plotly, requests and ipython. Any ideas of what's going on?
TypeError Traceback (most recent call last)
in ()
----> 1 from pyuvvis.plotting.plotlywrapper import figure
/home/adam/Desktop/pyuvvis/pyuvvis/plotting/plotlywrapper.py in ()
4 #import requests #bug if not imported
5 import logging
----> 6 import plotly.graph_objs as grobs
7 import numpy as np
8
/home/adam/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/plotly/init.py in ()
1 from . version import version
2 import graph_objs
----> 3 import plotly
4 import tools
/home/adam/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/plotly/plotly/init.py in ()
23
24 """
---> 25 from plotly import *
26
27 all = ["sign_in", "update_plot_options", "get_plot_options",
/home/adam/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/plotly/plotly/plotly.py in ()
15
16 """
---> 17 import requests
18 import chunked_requests
19 import json
/home/adam/Canopy/appdata/canopy-1.3.0.1715.rh5-x86/lib/python2.7/site-packages/requests/init.py in ()
51 # Attempt to enable urllib3's SNI support, if possible
52 try:
---> 53 from requests.packages.urllib3.contrib import pyopenssl
54 pyopenssl.inject_into_urllib3()
55 except ImportError:
/home/adam/Canopy/appdata/canopy-1.3.0.1715.rh5-x86/lib/python2.7/site-packages/requests/packages/init.py in ()
1 from future import absolute_import
2
----> 3 from . import urllib3
/home/adam/Canopy/appdata/canopy-1.3.0.1715.rh5-x86/lib/python2.7/site-packages/requests/packages/urllib3/init.py in ()
36 pass
37
---> 38 logging.getLogger(name).addHandler(NullHandler())
39
40 def add_stderr_logger(level=logging.DEBUG):
/home/adam/Canopy/appdata/canopy-1.3.0.1715.rh5-x86/lib/python2.7/logging/init.pyc in getLogger(name)
1555 """
1556 if name:
-> 1557 return Logger.manager.getLogger(name)
1558 else:
1559 return root
/home/adam/Canopy/appdata/canopy-1.3.0.1715.rh5-x86/lib/python2.7/logging/init.pyc in getLogger(self, name)
1031 rv.manager = self
1032 self.loggerDict[name] = rv
-> 1033 self._fixupChildren(ph, rv)
1034 self._fixupParents(rv)
1035 else:
/home/adam/Canopy/appdata/canopy-1.3.0.1715.rh5-x86/lib/python2.7/logging/init.pyc in _fixupChildren(self, ph, alogger)
1085 for c in ph.loggerMap.keys():
1086 #The if means ... if not c.parent.name.startswith(nm)
-> 1087 if c.parent.name[:namelen] != name:
1088 alogger.parent = c.parent
1089 c.parent = alogger
TypeError: 'NoneType' object has no attribute 'getitem'
I found a recent bug which was hard for me to trace. When I use the world_readable=False keyword in iplot_mpl(), I get a timeout. Not going to post the plot call because it uses custom libraries. Do you guys also get this timeout in general when doing
iplot_mpl(fig, world_readable=False)
HTTPError Traceback (most recent call last)
in ()
2
3 range_timeplot(ts.wavelength_slices(8), ax=ax)
----> 4 py.iplot_mpl(fig, update=_pyupdate, resize=False, world_readable=False)
/home/glue/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/plotly/plotly/plotly.pyc in iplot_mpl(fig, resize, strip_style, update, *_plot_options)
231 return iplot(fig, *_plot_options)
232
--> 233
234 def plot_mpl(fig, resize=True, strip_style=False, update=None, **plot_options):
235 """Replot a matplotlib figure with plotly.
/home/glue/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/plotly/plotly/plotly.pyc in iplot(figure_or_data, *_plot_options)
100 res = plot(figure_or_data, *_plot_options)
101 urlsplit = res.split('/')
--> 102 username, plot_id = urlsplit[-2][1:], urlsplit[-1] # TODO: HACKY!
103
104 embed_options = dict()
/home/glue/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/plotly/plotly/plotly.pyc in plot(figure_or_data, validate, *_plot_options)
183 res = _send_to_plotly(figure, *_plot_options)
184 if res['error'] == '':
--> 185 if plot_options['auto_open']:
186 try:
187 from webbrowser import open as wbopen
/home/glue/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/plotly/plotly/plotly.pyc in _send_to_plotly(figure, **plot_options)
568 return return_data['image']
569 else:
--> 570 try:
571 if ('content-type' in headers and
572 'json' in headers['content-type']):
/home/glue/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/requests/models.pyc in raise_for_status(self)
793
794 if http_error_msg:
--> 795 raise HTTPError(http_error_msg, response=self)
796
797 def close(self):