Improvement to lectures: Install Plotly


#1

Hi,

Following https://lectures.quantecon.org/jl/getting_started.html I encountered this error on the first plot,

using Plots
plot(sin, -2pi, pi, label="sine function")

Javascript error adding output!
ReferenceError: Plotly is not defined
See your browser Javascript console for more details.

Adding the Plotly package in Julia fixed this.

My versions,

The version of the notebook server is 4.3.1 and is running on:
Python 3.6.0 |Anaconda 4.3.1 (64-bit)| (default, Dec 23 2016, 11:57:41) [MSC v.1900 64 bit (AMD64)]

#2

Hi @Janek. I can’t seem to replicate this issue. Can you confirm if you had installed the Plots package?

Pkg.add("Plots")


#3

FWIW this is my entire session setting up Jupyter. It includes the manual addition of Plotly which fixed the JavaScript error,

       _

_ _ ()_ | A fresh approach to technical computing
() | () () | Documentation: http://docs.julialang.org
_ _ | | __ _ | Type “?help” for help.
| | | | | | |/ ` | |
| | |
| | | | (
| | | Version 0.5.1 (2017-03-05 13:25 UTC)
/ |_|||_’_| | Official http://julialang.org/ release
|__/ | x86_64-w64-mingw32

julia> Pkg.add(“IJulia”)
INFO: Nothing to be done
INFO: METADATA is out-of-date — you may not have the latest version of IJulia
INFO: Use Pkg.update() to get the latest versions of your packages

julia> Pkg.update()
INFO: Updating METADATA…
INFO: Updating cache of DataFrames…
INFO: Updating cache of DataFrames…
INFO: Computing changes…
INFO: No packages to install, update or remove

julia> Pkg.add(“Plots”)
INFO: Nothing to be done

julia> Pkg.add(“Plotly”)
INFO: Cloning cache of Blink from
INFO: Cloning cache of Codecs from
INFO: Cloning cache of DocStringExtensions from
INFO: Cloning cache of Hiccup from
INFO: Cloning cache of HttpCommon from
INFO: Cloning cache of HttpParser from
INFO: Cloning cache of HttpServer from
INFO: Cloning cache of Juno from
INFO: Cloning cache of LaTeXStrings from
INFO: Cloning cache of Lazy from
INFO: Cloning cache of MacroTools from
INFO: Cloning cache of MbedTLS from
INFO: Cloning cache of Media from
INFO: Cloning cache of Mustache from
INFO: Cloning cache of Mux from
INFO: Cloning cache of Plotly from
INFO: Cloning cache of PlotlyJS from
INFO: Cloning cache of Requests from
INFO: Cloning cache of WebSockets from
INFO: Installing Blink v0.5.1
INFO: Installing Codecs v0.3.0
INFO: Installing DocStringExtensions v0.3.1
INFO: Installing Hiccup v0.1.1
INFO: Installing HttpCommon v0.2.6
INFO: Installing HttpParser v0.2.0
INFO: Installing HttpServer v0.1.7
INFO: Installing Juno v0.2.7
INFO: Installing LaTeXStrings v0.2.0
INFO: Installing Lazy v0.11.5
INFO: Installing MacroTools v0.3.6
INFO: Installing MbedTLS v0.4.3
INFO: Installing Media v0.2.5
INFO: Installing Mustache v0.1.3
INFO: Installing Mux v0.2.3
INFO: Installing Plotly v0.1.1
INFO: Installing PlotlyJS v0.5.2
INFO: Installing Requests v0.4.1
INFO: Installing WebSockets v0.2.1
INFO: Building HttpParser
INFO: Attempting to Create directory C:\Users\janek.julia\v0.5\HttpParser\deps\downloads
INFO: Downloading file
INFO: Done downloading file
INFO: Attempting to Create directory C:\Users\janek.julia\v0.5\HttpParser
INFO: Directory C:\Users\janek.julia\v0.5\HttpParser already created

7-Zip [64] 9.20 Copyright © 1999-2010 Igor Pavlov 2010-11-18

Processing archive: C:\Users\janek.julia\v0.5\HttpParser\deps\downloads\libhttp_parser_2_7_1.zip

Extracting usr\lib
Extracting usr\lib\libhttp_parser32.dll
Extracting usr\lib\libhttp_parser64.dll

Everything is Ok

Folders: 1
Files: 2
Size: 263925
Compressed: 91886
INFO: Building MbedTLS
Using system libraries…
INFO: Package database updated

julia> Pkg.add(“QuantEcon”)
INFO: Cloning cache of AutoHashEquals from
INFO: Cloning cache of Blosc from
INFO: Cloning cache of Calculus from
INFO: Cloning cache of DSP from
INFO: Cloning cache of Distributions from
INFO: Cloning cache of EzXML from
INFO: Cloning cache of HDF5 from
INFO: Cloning cache of JLD from
INFO: Cloning cache of LegacyStrings from
INFO: Cloning cache of LightGraphs from
INFO: Cloning cache of PDMats from
INFO: Cloning cache of ParserCombinator from
INFO: Cloning cache of Polynomials from
INFO: Cloning cache of Primes from
INFO: Cloning cache of QuadGK from
INFO: Cloning cache of QuantEcon from
INFO: Cloning cache of Rmath from
INFO: Cloning cache of StatsFuns from
INFO: Installing AutoHashEquals v0.1.1
INFO: Installing Blosc v0.2.0
INFO: Installing Calculus v0.2.1
INFO: Installing DSP v0.1.1
INFO: Installing Distributions v0.12.1
INFO: Installing EzXML v0.4.3
INFO: Installing HDF5 v0.7.3
INFO: Installing JLD v0.6.9
INFO: Installing LegacyStrings v0.2.0
INFO: Installing LightGraphs v0.7.3
INFO: Installing PDMats v0.5.6
INFO: Installing ParserCombinator v1.7.11
INFO: Installing Polynomials v0.1.3
INFO: Installing Primes v0.1.2
INFO: Installing QuadGK v0.1.1
INFO: Installing QuantEcon v0.9.0
INFO: Installing Rmath v0.1.6
INFO: Installing StatsFuns v0.4.0
INFO: Building Blosc
INFO: Building Rmath
INFO: Attempting to Create directory C:\Users\janek.julia\v0.5\Rmath\deps\downloads
INFO: Downloading file
INFO: Done downloading file
INFO: Attempting to Create directory C:\Users\janek.julia\v0.5\Rmath
INFO: Directory C:\Users\janek.julia\v0.5\Rmath already created

7-Zip [64] 9.20 Copyright © 1999-2010 Igor Pavlov 2010-11-18

Processing archive: C:\Users\janek.julia\v0.5\Rmath\deps\downloads\libRmath-julia.7z

Extracting COPYING
Extracting bin32\libRmath-julia.dll
Extracting bin64\libRmath-julia.dll
Extracting bin64
Extracting bin32

Everything is Ok

Folders: 2
Files: 3
Size: 866238
Compressed: 232867
INFO: Building WinRPM
INFO: Downloading
INFO: Downloading
INFO: Downloading
INFO: Downloading
INFO: Building EzXML
INFO: Packages to install: zlib1, libxml2-2
INFO: Downloading: zlib1
INFO: Extracting: zlib1
INFO: Downloading: libxml2-2
INFO: Extracting: libxml2-2
INFO: Complete
INFO: Building HDF5
INFO: Updating WinRPM package list
INFO: Downloading
INFO: Downloading
INFO: Packages to install: hdf5
INFO: Downloading: hdf5
INFO: Extracting: hdf5
INFO: Complete
INFO: Package database updated

julia>


#4

The error is back today!

This is the error,

This is what I did in the Julia console but the error persists

julia> Pkg.add("Plotly")
INFO: Nothing to be done
INFO: METADATA is out-of-date — you may not have the latest version of Plotly
INFO: Use `Pkg.update()` to get the latest versions of your packages

julia> Pkg.update()
INFO: Updating METADATA...
INFO: Updating cache of DataFrames...
INFO: Updating cache of DataFrames...
INFO: Computing changes...
INFO: No packages to install, update or remove

julia> VERSION
v"0.5.1"

julia>

#5

Could you try Pkg.build("Plots") and make sure that the latest java is installed?


#6

It’s now working.

The first step did not help,

julia> Pkg.build("Plots")
INFO: Building Plots

shell> java -version
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)

I then closed and halted the kernel from the notebook, started Jupyter,

Thanks everyone for the help.