# PyPlot Won't Precompile Julia 5.0

**URL:** <https://discourse.julialang.org/t/pyplot-wont-precompile-julia-5-0/4202>\
**Category:** New to Julia\
**Created:** [June 10, 2017, 8:56pm UTC](https://discourse.julialang.org/t/pyplot-wont-precompile-julia-5-0/4202 "2017-06-10T20:56:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DoctorRadar](https://avatars.discourse-cdn.com/v4/letter/d/f475e1/32.png) [@DoctorRadar](https://discourse.julialang.org/u/DoctorRadar)\
**Post date:** [June 10, 2017, 8:56pm UTC](https://discourse.julialang.org/t/pyplot-wont-precompile-julia-5-0/4202/1 "2017-06-10T20:56:06Z")

</div>

Hello.

I’m keen to try Julia after being a Matlab user for over 15 years. Embarrassingly, I’m struggling to get the environment set up. I have a MacBook Pro and the OS is up to date. I have installed that latest version of Anaconda to get a good Python environment. I have installed the latest version of Julia (5.0) from the [julialang.org](http://julialang.org) website. While simple commands like 2+2 work just fine, when I try to include packages, such as PyPlot, they will not precompile.

As an example of the errors I get, see:

> julia\> Pkg.update( )  
> INFO: Updating METADATA…  
> INFO: Updating Compat master…  
> INFO: Updating CodeTools master…  
> INFO: Computing changes…  
> INFO: No packages to install, update or remove

> julia\> Pkg.update( “PyPlot” )  
> INFO: Updating METADATA…  
> INFO: Updating Compat master…  
> INFO: Computing changes…  
> INFO: Package PyPlot was set to version 2.1.0, but a higher version 2.3.2 exists.  
> To install the latest version, you could try doing a full update with `Pkg.update()`.  
> INFO: No packages to install, update or remove

> julia\> using PyPlot  
> INFO: Precompiling module PyPlot.

> WARNING: deprecated syntax “(AbstractString=\>Any)[a=\>b for (a,b) in c]” at /Users/gsmith/.julia/v0.5/PyCall/src/PyCall.jl:395.  
> Use “Dict{AbstractString,Any}(a=\>b for (a,b) in c)” instead.  
> ERROR: LoadError: LoadError: `wstring` has been moved to the package LegacyStrings.jl:  
> Run Pkg.add(“LegacyStrings”) to install LegacyStrings on Julia v0.5-;  
> Then do `using LegacyStrings` to get `wstring`.

> in include\_from\_node1(::String) at ./loading.jl:488  
> in include\_from\_node1(::String) at /Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib:?  
> in include\_from\_node1(::String) at ./loading.jl:488  
> in include\_from\_node1(::String) at /Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib:?  
> in macro expansion; at ./none:2 [inlined]  
> in anonymous at ./:?  
> in eval(::Module, ::Any) at ./boot.jl:234  
> in eval(::Module, ::Any) at /Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib:?  
> in process\_options(::Base.JLOptions) at ./client.jl:242  
> in \_start() at ./client.jl:321  
> in \_start() at /Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib:?  
> while loading /Users/gsmith/.julia/v0.5/PyCall/src/…/deps/deps.jl, in expression starting on line 3  
> while loading /Users/gsmith/.julia/v0.5/PyCall/src/PyCall.jl, in expression starting on line 37  
> ERROR: LoadError: Failed to precompile PyCall to /Users/gsmith/.julia/lib/v0.5/PyCall.ji.  
> in compilecache(::String) at ./loading.jl:593  
> in require(::Symbol) at ./loading.jl:393  
> in require(::Symbol) at /Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib:?  
> in include\_from\_node1(::String) at ./loading.jl:488  
> in include\_from\_node1(::String) at /Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib:?  
> in macro expansion; at ./none:2 [inlined]  
> in anonymous at ./:?  
> in eval(::Module, ::Any) at ./boot.jl:234  
> in eval(::Module, ::Any) at /Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib:?  
> in process\_options(::Base.JLOptions) at ./client.jl:242  
> in \_start() at ./client.jl:321  
> in \_start() at /Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib:?  
> while loading /Users/gsmith/.julia/v0.5/PyPlot/src/PyPlot.jl, in expression starting on line 5  
> ERROR: Failed to precompile PyPlot to /Users/gsmith/.julia/lib/v0.5/PyPlot.ji.  
> in compilecache(::String) at ./loading.jl:593  
> in require(::Symbol) at ./loading.jl:422  
> in require(::Symbol) at /Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib:?

Running versioninfo() gives me

> Julia Version 0.5.2  
> Commit f4c6c9d4bb (2017-05-06 16:34 UTC)  
> Platform Info:  
> OS: macOS (x86\_64-apple-darwin13.4.0)  
> CPU: Intel(R) Core™ i7-4870HQ CPU @ 2.50GHz  
> WORD\_SIZE: 64  
> BLAS: libopenblas (USE64BITINT DYNAMIC\_ARCH NO\_AFFINITY Haswell)  
> LAPACK: libopenblas64\_  
> LIBM: libopenlibm  
> LLVM: libLLVM-3.7.1 (ORCJIT, haswell)

I have tried installing Julia 4.7 and everything works just fine! However, I would like to use the latest Julia because ultimately I wish to work in the Juno environment in Atom and this doesn’t seem backwards compatible to older versions of Julia.

Thanks for the help

---

<div class="post-metadata">

**Author:** ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Post date:** [June 10, 2017, 10:57pm UTC](https://discourse.julialang.org/t/pyplot-wont-precompile-julia-5-0/4202/2 "2017-06-10T22:57:29Z")

</div>

The version of PyPlot that you have is pretty ancient, so I’m not surprised to see it failing on v0.5. But it’s weird to see that it isn’t updating. How did you install PyPlot?

One possibility is that you have another package installed which requires an extremely old PyPlot version. What does Pkg.installed() show?

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [June 11, 2017, 11:14am UTC](https://discourse.julialang.org/t/pyplot-wont-precompile-julia-5-0/4202/3 "2017-06-11T11:14:48Z")

</div>

> [@DoctorRadar](#):
>
> I have installed that latest version of Anaconda

(Note that, as explained in the PyCall README, PyCall on Mac will install its own miniconda environment by default, via Conda.jl, so this isn’t necessary or even helpful. It won’t hurt you, but a new PyCall install will default to simply ignoring your Anaconda install unless you do `ENV["PYTHON"]="python"` before doing `Pkg.add` for the first time or in a subsequent `Pkg.build("PyCall")`. Once you’ve told PyCall what Python you want it to use, you don’t need to set this environment variable again.)

From the fact that you have an ancient version of PyPlot, I’m guessing that you were messing around with your package versions at some point. If you are new to Julia and you don’t have anything important installed, it might be easiest to just start over. `rm -rf ~/.julia` and then `Pkg.add("PyPlot")`.

---

<div class="post-metadata">

**Author:** ![DoctorRadar](https://avatars.discourse-cdn.com/v4/letter/d/f475e1/32.png) [@DoctorRadar](https://discourse.julialang.org/u/DoctorRadar)\
**Post date:** [June 11, 2017, 6:20pm UTC](https://discourse.julialang.org/t/pyplot-wont-precompile-julia-5-0/4202/4 "2017-06-11T18:20:49Z")

</div>

Thanks for the help!

Deleting the ~/.julia folder worked a treat. Everything is working now.

I had tried uninstalling and reinstalling Julia a couple of times. I guess that using appcleaner wasn’t removing that directory, so whatever I messed up on my first install wasn’t being cleared.

@rdeits: I had installed Julia with the official installer from [julialang.org](http://julialang.org) I must have done something wrong on the first install and then because the ~/.julia folder is persistent I couldn’t undo it easily.

I’m happy for this thread to be closed now
