Using PyPlot Not Working

251 views
Skip to first unread message

Anthony Niznik

unread,
Sep 9, 2016, 4:27:48 AM9/9/16
to JuliaBox
Hello All,

I am using JuliaBox (0.4.6) for a homework assignment and when I call functions from Python like PyPlot, I get an error. Any ideas? I have tried adding Pyplot package and PyCall. I have also downloaded Python 2.7 to my computer. I need to use the clf() function from Pyplot.

Code:
# We'll use the PyPlot (matplotlib) plotting library:
# It works exactly as it would in Python.

using PyPlot

Error:
INFO: Recompiling stale cache file /opt/julia_packages/.julia/lib/v0.4/PyPlot.ji for module PyPlot.
INFO: Recompiling stale cache file /opt/julia_packages/.julia/lib/v0.4/PyCall.ji for module PyCall.
ERROR: LoadError: LoadError: PyCall not properly installed. Please run Pkg.build("PyCall")
 [inlined code] from /home/juser/.julia/v0.4/PyCall/src/startup.jl:45
 in anonymous at no file:0
 in include at ./boot.jl:261
 in include_from_node1 at ./loading.jl:320
 in include at ./boot.jl:261
 in include_from_node1 at ./loading.jl:320
 [inlined code] from none:2
 in anonymous at no file:0
 in process_options at ./client.jl:257
 in _start at ./client.jl:378
while loading /home/juser/.julia/v0.4/PyCall/src/startup.jl, in expression starting on line 42
while loading /home/juser/.julia/v0.4/PyCall/src/PyCall.jl, in expression starting on line 37
ERROR: LoadError: Failed to precompile PyCall to /home/juser/.julia/lib/v0.4/PyCall.ji
 in error at ./error.jl:21
 in compilecache at loading.jl:400
 in recompile_stale at loading.jl:476
 in _require_from_serialized at loading.jl:83
 in _require_from_serialized at ./loading.jl:109
 in require at ./loading.jl:235
 in include at ./boot.jl:261
 in include_from_node1 at ./loading.jl:320
 [inlined code] from none:2
 in anonymous at no file:0
 in process_options at ./client.jl:257
 in _start at ./client.jl:378
while loading /home/juser/.julia/v0.4/PyPlot/src/PyPlot.jl, in expression starting on line 5
LoadError: Failed to precompile PyPlot to /home/juser/.julia/lib/v0.4/PyPlot.ji
while loading In[2], in expression starting on line 4

 in error at ./error.jl:21
 in compilecache at loading.jl:400
 in recompile_stale at loading.jl:476
 in _require_from_serialized at loading.jl:83
 in _require_from_serialized at ./loading.jl:109
 in require at ./loading.jl:235

Nishanth Kottary

unread,
Sep 9, 2016, 4:37:38 AM9/9/16
to juli...@googlegroups.com
Hi Anthony,

Due to a precompilation issue on Julia and JuliaBox this error sometimes happens for packages that were `Pkg.add()`ed.  To use the default PyPlot installed by us delete your `~/.julia`.  You can do this by going to console and typing `rm -rf ~/.julia` or go to settings page and click on "Reset my packages".

The precompilation issue will be fixed soon.  The above instruction is a temporary workaround for now.

Thanks,
Nishanth

--
You received this message because you are subscribed to the Google Groups "JuliaBox" group.
To unsubscribe from this group and stop receiving emails from it, send an email to julia-box+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Anthony Niznik

unread,
Sep 9, 2016, 9:54:58 AM9/9/16
to JuliaBox
Hi Nishanth,

Yes, the `rm -rf ~/.julia` worked great. Thank you so much!

Best,
Anthony
To unsubscribe from this group and stop receiving emails from it, send an email to julia-box+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages