beljun / zeppelin-plotly Goto Github PK
View Code? Open in Web Editor NEWOne way of using Plot.ly on Zeppelin notebooks
One way of using Plot.ly on Zeppelin notebooks
Package doesn't work with latest plotly 4.
Hi,
Is this hack still maintained? I followed the installation instruction and get an error when trying to import.
### --- Plotty Hack --- ###
import sys
sys.path.insert(0, "/opt/zeppelin-plotly")
import offline
sys.modules["plotly"].offline = offline
sys.modules["plotly.offline"] = offline
import cufflinks as cf
cf.go_offline()
### --- End --- ###
Traceback (most recent call last):
File "/tmp/zeppelin_pyspark-579679853042456589.py", line 346, in <module>
raise Exception(traceback.format_exc())
Exception: Traceback (most recent call last):
File "/tmp/zeppelin_pyspark-579679853042456589.py", line 334, in <module>
exec(code)
File "<stdin>", line 3, in <module>
File "/opt/zeppelin-plotly/offline/__init__.py", line 6, in <module>
from . offline import (
File "/opt/zeppelin-plotly/offline/offline.py", line 14, in <module>
import plotly
File "/usr/lib/python2.7/site-packages/plotly/__init__.py", line 31, in <module>
from plotly import (plotly, graph_objs, grid_objs, tools, utils, session,
File "/usr/lib/python2.7/site-packages/plotly/plotly/__init__.py", line 10, in <module>
from . plotly import (
File "/usr/lib/python2.7/site-packages/plotly/plotly/plotly.py", line 27, in <module>
from plotly import exceptions, files, session, tools, utils
File "/usr/lib/python2.7/site-packages/plotly/tools.py", line 60, in <module>
matplotlylib = optional_imports.get_module('plotly.matplotlylib')
File "/usr/lib/python2.7/site-packages/plotly/optional_imports.py", line 23, in get_module
return import_module(name)
File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/usr/lib/python2.7/site-packages/plotly/matplotlylib/__init__.py", line 14, in <module>
from plotly.matplotlylib.renderer import PlotlyRenderer
File "/usr/lib/python2.7/site-packages/plotly/matplotlylib/renderer.py", line 13, in <module>
import plotly.graph_objs as go
File "/usr/lib/python2.7/site-packages/plotly/graph_objs/__init__.py", line 14, in <module>
from plotly.graph_objs.graph_objs import * # this is protected with __all__
File "/usr/lib/python2.7/site-packages/plotly/graph_objs/graph_objs.py", line 34, in <module>
from plotly import exceptions, graph_reference
File "/usr/lib/python2.7/site-packages/plotly/graph_reference.py", line 232, in <module>
@utils.memoize()
File "/usr/lib/python2.7/site-packages/plotly/utils.py", line 492, in memoize
return decorator(_memoize)
File "/usr/lib/python2.7/site-packages/decorator.py", line 213, in decorator
fun = getfullargspec(callerfunc).args[0] # first arg
IndexError: list index out of range
On a recent install of HDP on centos I had %pyspark repeatedly report an error on
import offline
err msg was I had not installed the plotly (which I had done using sudo pip install plotly )
On double checking it turns out I needed to use the following on the command line to install the modules needed so zeppelin picked it up properly:
sudo python -m pip install plotly numpy pandas scipy matplotlib IPython cufflinks
Now it's all working. All good.
May I suggest you update the readme with a little note for users if they get that error? (I spent ages hunting around for the issue.)
thanks for such a super useful package btw!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.