Dave_L
Dave_L

Reputation: 383

How to use packages in Julia Studio

I can't get the package system to work in Julia Studio. For example if I want to plot a simple graph I've tried double clicking the Winston package which seems to install from the Git repo, then:

using Winston
plot([1 2 3],[3 2 6])

But I get the error:

could not open file /Applications/JuliaStudio.app/Contents/Resources/juliaengine/Winston.jl

Which looks like Julia is looking in the wrong directory. How should I set up Julia Studio to correctly work with the packages?

Response to Adam: thanks, unfortunately there seem to be a few issues. When I try to remove/add the Winston package I get a message like:

julia> Pkg.rm("Winston")
ERROR: Unknown dependency for ODBC: julia
in dependencies at pkg/metadata.jl:156
in ReqsStruct at pkg/resolve.jl:65
in resolve at pkg/resolve.jl:1162
in _resolve at pkg.jl:230
in anonymous at no file:163
in cd at file.jl:26
in cd_pkgdir at pkg.jl:34
in rm at pkg.jl:141
in rm at pkg.jl:165

I'll spend some more time on this and try and work out what's going on. I'll post an update for completeness if I get anywhere.

UPDATE I'm now up to Julia Studio version 0.4.4 and after updating the packages the original example works. Unfortunately I can't determine the original problem but it looks like a complex dependency or version issue.

Upvotes: 6

Views: 4877

Answers (2)

elyase
elyase

Reputation: 40963

This is what I did:

  1. Remove the $HOME/.julia folder (this will also erase all previously installed packages)
  2. Run from a terminal/console

    Last login: Sat Jul 27 02:58:06 on ttys001
    ~  ᐅ /Applications/JuliaStudio.app/julia/bin/julia-release-readline
               _
       _       _ _(_)_     |  A fresh approach to technical computing
      (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
       _ _   _| |_  __ _   |  Type "help()" to list help topics
      | | | | | | |/ _` |  |
      | | |_| | | | (_| |  |  Version 0.1.2+111981303.ra703.dirty
     _/ |\__'_|_|_|\__'_|  |  Commit a703335d02 (2013-03-10 22:34:09)*
    |__/                   |
    
    julia> 
    
  3. Install the package

    julia> Pkg.add("Winston")
    MESSAGE: Auto-initializing default package repository /Users/elyase/.julia.
               ...
    

It works!

Upvotes: 2

Adam
Adam

Reputation: 12650

I think it's related to this issue: https://github.com/forio/julia-studio/issues/83

The Winston installation requires external dependencies and prompts you for your input on how you want to install them. Julia Studio doesn't allow you to respond to this input.

Here's the workaround:

In your console, enter:

/Applications/JuliaStudio.app/julia/bin/julia-release-readline

Then

Pkg.rm("Winston")
Pkg.add("Winston")

Follow the prompts and when it's done close the process and return to Julia Studio.

Winston should now be working.

Upvotes: 5

Related Questions