Hi Linus,

This is due to a change in Julia master 
<https://github.com/JuliaLang/julia/commit/4220ecebf107997ec7d44bd2a6236f7898e83473>
 which 
altered the way timers work. It's broken PyCall and therefore PyPlot in 
this particular case.

There are pending pull requests on PyCall which should fix this, but they 
haven't been merged yet. You could check this one 
<https://github.com/stevengj/PyCall.jl/pull/155> out locally by doing the 
following (at the command line):

   - go to your Julia package directory - not sure what it is on Windows
   - go to v0.4/PyCall
   - git fetch origin pull/155/head:fix-timer-api
      - this will make a copy of the pull request on your machine in a 
      branch called "fix-timer-api"
   - git checkout fix-timer-api
      - this will switch to that branch
   
This got PyPlot working again for me. Note that it will freeze your version 
of PyCall so, once these fixes are actually merged into the package itself, 
you can swap to the latest version by doing Pkg.checkout("PyCall") from 
within Julia.

Cheers,
Scott


On Thursday, 18 June 2015 15:27:51 UTC+1, Linus Härenstam-Nielsen wrote:
>
> I am having problems with using PyPlot in the nightly build (version 
> 0.4.0). Typing 'using PyPlot' followed by 'plot([sin(a) for 
> a=linspace(0,2*pi)])' yields the following:
>
>                _
>    _       _ _(_)_     |  A fresh approach to technical computing
>   (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
>    _ _   _| |_  __ _   |  Type "help()" for help.
>   | | | | | | |/ _` |  |
>   | | |_| | | | (_| |  |  Version 0.4.0-dev+5416 (2015-06-17 00:39 UTC)
>  _/ |\__'_|_|_|\__'_|  |  Commit 0bb31a0 (1 day old master)
> |__/                   |  x86_64-w64-mingw32
>
> julia> using PyPlot
> Warning: New definition
>     call(Type{PyCall.PyDict}, Base.Associative{#K<:Any, Any}) at 
> C:\Users\Linus\.julia\v0.4\PyCall
> rc\conversions.jl:464
> is ambiguous with:
>     call(Type{PyCall.PyDict}, Base.Associative{Any, #V<:Any}) at 
> C:\Users\Linus\.julia\v0.4\PyCall
> rc\conversions.jl:463.
> To fix, define
>     call(Type{PyCall.PyDict}, Base.Associative{Any, Any})
> before the new definition.
> WARNING: No working GUI backend found for matplotlib.
> C:\Anaconda\lib\site-packages\matplotlib\__init__.py:1318: UserWarning: 
>  This call to matplotlib.u
> () has no effect
> because the backend has already been chosen;
> matplotlib.use() must be called *before* pylab, matplotlib.pyplot,
> or matplotlib.backends is imported for the first time.
>
>   warnings.warn(_use_error_msg)
> WARNING: ntuple(n::Integer,f::Function) is deprecated, use ntuple(f,n) 
> instead.
>  in depwarn at deprecated.jl:62
>  in ntuple at deprecated.jl:49
>  in convert at C:\Users\Linus\.julia\v0.4\PyCall\src\conversions.jl:222
>  in py2array at C:\Users\Linus\.julia\v0.4\PyCall\src\conversions.jl:73
>  in convert at C:\Users\Linus\.julia\v0.4\PyCall\src\conversions.jl:429
>  in pywrap at C:\Users\Linus\.julia\v0.4\PyCall\src\PyCall.jl:305
>  in pywrap at C:\Users\Linus\.julia\v0.4\PyCall\src\PyCall.jl:304
>  in __init__ at C:\Users\Linus\.julia\v0.4\PyPlot\src\PyPlot.jl:149
>  in include at boot.jl:254
>  in include_from_node1 at loading.jl:133
>  in reload_path at loading.jl:157
>  in _require at loading.jl:69
>  in require at loading.jl:52
> while loading C:\Users\Linus\.julia\v0.4\PyPlot\src\PyPlot.jl, in 
> expression starting on line 560
>
> julia> plot([sin(a) for a=linspace(0,2*pi)])
> WARNING: ntuple(n::Integer,f::Function) is deprecated, use ntuple(f,n) 
> instead.
>  in depwarn at deprecated.jl:62
>  in ntuple at deprecated.jl:49
>  in convert at C:\Users\Linus\.julia\v0.4\PyCall\src\conversions.jl:222
>  in convert at C:\Users\Linus\.julia\v0.4\PyCall\src\conversions.jl:846
>  in jl_Function_call at 
> C:\Users\Linus\.julia\v0.4\PyCall\src\callback.jl:36
>  in pycall at C:\Users\Linus\.julia\v0.4\PyCall\src\PyCall.jl:73
>  in plot at C:\Users\Linus\.julia\v0.4\PyPlot\src\PyPlot.jl:371
>  in anonymous at no file
> while loading no file, in expression starting on line 0
> 1-element Array{Any,1}:
>  PyObject <matplotlib.lines.Line2D object at 0x000000001555D080>
>
> julia> plot([sin(a) for a=linspace(0,2*pi)])
> 1-element Array{Any,1}:
>  PyObject <matplotlib.lines.Line2D object at 0x000000001555D2B0>
>
>
> As you can see importing PyPlot produces several warnings, one of them is 
> 'WARNING: 
> No working GUI backend found for matplotlib' which led me to believe there 
> is a problem with loading matplotlib? I am using python 2.7.9 on windows 
> 8.1 with the Anaconda 2.2.0 distribution and matplotlib version 1.4.3. 
>
> The plot function returns a PyObject properly but no plot window is 
> opened. In Julia 0.3.9 everything works as you would expect with no 
> warnings.
>
> Any ideas?
>

Reply via email to