Issue with plotting

I am trying to plot some values.

So I imported plotlyjs:

using Plots
plotlyjs()

I am getting:

INFO: Precompiling module PlotlyJS.
ERROR: LoadError: HttpParser not properly installed. Please run
Pkg.build(“HttpParser”)
Stacktrace:
[1] error(::String, ::String, ::Vararg{String,N} where N) at ./error.jl:30
[2] include_from_node1(::String) at ./loading.jl:576
[3] include(::String) at ./sysimg.jl:14
[4] anonymous at ./:2
while loading /home/subhankar/.julia/v0.6/HttpParser/src/HttpParser.jl, in expression starting on line 9
ERROR: LoadError: LoadError: Failed to precompile HttpParser to /home/subhankar/.julia/lib/v0.6/HttpParser.ji.
Stacktrace:
[1] compilecache(::String) at ./loading.jl:710
[2] _require(::Symbol) at ./loading.jl:463
[3] require(::Symbol) at ./loading.jl:405
[4] include_from_node1(::String) at ./loading.jl:576
[5] include(::String) at ./sysimg.jl:14
[6] include_from_node1(::String) at ./loading.jl:576
[7] include(::String) at ./sysimg.jl:14
[8] anonymous at ./:2
while loading /home/subhankar/.julia/v0.6/HttpServer/src/RequestParser.jl, in expression starting on line 16
while loading /home/subhankar/.julia/v0.6/HttpServer/src/HttpServer.jl, in expression starting on line 12
ERROR: LoadError: LoadError: Failed to precompile HttpServer to /home/subhankar/.julia/lib/v0.6/HttpServer.ji.
Stacktrace:
[1] compilecache(::String) at ./loading.jl:710
[2] _require(::Symbol) at ./loading.jl:463
[3] require(::Symbol) at ./loading.jl:405
[4] include_from_node1(::String) at ./loading.jl:576
[5] include(::String) at ./sysimg.jl:14
[6] include_from_node1(::String) at ./loading.jl:576
[7] include(::String) at ./sysimg.jl:14
[8] anonymous at ./:2
while loading /home/subhankar/.julia/v0.6/Mux/src/server.jl, in expression starting on line 1
while loading /home/subhankar/.julia/v0.6/Mux/src/Mux.jl, in expression starting on line 24
ERROR: LoadError: LoadError: Failed to precompile Mux to /home/subhankar/.julia/lib/v0.6/Mux.ji.
Stacktrace:
[1] compilecache(::String) at ./loading.jl:710
[2] _require(::Symbol) at ./loading.jl:463
[3] require(::Symbol) at ./loading.jl:405
[4] include_from_node1(::String) at ./loading.jl:576
[5] include(::String) at ./sysimg.jl:14
[6] include_from_node1(::String) at ./loading.jl:576
[7] include(::String) at ./sysimg.jl:14
[8] anonymous at ./:2
while loading /home/subhankar/.julia/v0.6/Blink/src/content/content.jl, in expression starting on line 1
while loading /home/subhankar/.julia/v0.6/Blink/src/Blink.jl, in expression starting on line 9
ERROR: LoadError: Failed to precompile Blink to /home/subhankar/.julia/lib/v0.6/Blink.ji.
Stacktrace:
[1] compilecache(::String) at ./loading.jl:710
[2] _require(::Symbol) at ./loading.jl:463
[3] require(::Symbol) at ./loading.jl:405
[4] include_from_node1(::String) at ./loading.jl:576
[5] include(::String) at ./sysimg.jl:14
[6] anonymous at ./:2
while loading /home/subhankar/.julia/v0.6/PlotlyJS/src/PlotlyJS.jl, in expression starting on line 17
if !Plots.is_installed(“PlotlyJS”)
Pkg.add(“PlotlyJS”)
end
if !Plots.is_installed(“Rsvg”)
Pkg.add(“Rsvg”)
end
import Blink
Blink.AtomShell.install()

WARNING: Couldn’t initialize plotlyjs. (might need to install it?)
INFO: To do a standard install of plotlyjs, copy and run this:

Failed to precompile PlotlyJS to /home/subhankar/.julia/lib/v0.6/PlotlyJS.ji.

I tried:
Pkg.build("HttpParser")

Am getting:

make: Entering directory ‘/home/subhankar/.julia/v0.6/HttpParser/deps/src/http-parser-2.7.1’
cc -I. -DHTTP_PARSER_STRICT=0 -Wall -Wextra -Werror -O3 -fPIC -c http_parser.c -o libhttp_parser.o
In file included from http_parser.c:24:0:
http_parser.h:32:10: fatal error: sys/types.h: No such file or directory
#include <sys/types.h>
^~~~~~~~~~~~~
compilation terminated.
Makefile:102: recipe for target ‘libhttp_parser.o’ failed
make: *** [libhttp_parser.o] Error 1
make: Leaving directory ‘/home/subhankar/.julia/v0.6/HttpParser/deps/src/http-parser-2.7.1’
================================[ BUILD ERRORS ]================================

WARNING: HttpParser had build errors.

  • packages with build errors remain installed in /home/subhankar/.julia/v0.6
  • build the package(s) and all dependencies with Pkg.build("HttpParser")
  • build a single package by running its deps/build.jl script

Any help please? Thanks!

It looks like you don’t have a sufficient development environment. For example, on Ubuntu/Debian etc., you may install the “build-essentials” package to get a good foundation. For other operating system distributions, check your system documentation.

2 Likes

Hi,
Thanks for replying. Do you mean:

Pkg.add("build-essentials")

I am getting:

ERROR: unknown package build-essentials
macro expansion at ./pkg/entry.jl:53 [inlined]
(::Base.Pkg.Entry.##1#3{String,Base.Pkg.Types.VersionSet})() at ./task.jl:335
Stacktrace:
[1] sync_end() at ./task.jl:287
[2] macro expansion at ./task.jl:303 [inlined]
[3] add(::String, ::Base.Pkg.Types.VersionSet) at ./pkg/entry.jl:51
[4] (::Base.Pkg.Dir.##4#7{Array{Any,1},Base.Pkg.Entry.#add,Tuple{String}})() at ./pkg/dir.jl:36
[5] cd(::Base.Pkg.Dir.##4#7{Array{Any,1},Base.Pkg.Entry.#add,Tuple{String}}, ::String) at ./file.jl:70
[6] #cd#1(::Array{Any,1}, ::Function, ::Function, ::String, ::Vararg{String,N} where N) at ./pkg/dir.jl:36
[7] add(::String) at ./pkg/pkg.jl:117

I am on Linux Mint 19 and using IJulia

No, it’s an operating system package which insures the installation of the C compiler and some support. (You’ve got a compiler, but not the support.)

1 Like

Thanks a lot!

While updating it shows:

build-essential is already the newest version (12.4ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 15 not upgraded.

Could it be this issue?

In that case it could be fixed by running apt-get install make gcc in a terminal (EDIT: though if this was the issue build-essentials should already provide everything you need).

Slightly tangentially, even though it could potentially be a fair amount of work, several packages (Blink, Juno, PlotlyJS, …) would probably be easier to install if if they relied on HTTP.jl (no binary dependency) rather than on HTTPParser: not sure if they’re planning to transition though.