Remi.b
Remi.b

Reputation: 18239

Trying to load a package in Julia

I'd like to use the function bitrand(), which is in the compat.jl package. Here is what I did:

julia> Pkg.add("compat")
INFO: Nothing to be done

julia> using Compat

julia> bitrand()
ERROR: bitrand not defined

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

julia> using Compat

julia> bitrand()
ERROR: bitrand not defined

julia> Compat.bitrand()
ERROR: bitrand not defined

For info, I am using Julia-0.3.2. Thank you!

EDIT

julia> Pkg.status()
3 required packages:
 - Compat                        0.2.10
 - Distributions                 0.6.3
 - StatsBase                     0.6.10
3 additional packages:
 - ArrayViews                    0.4.8
 - JSON                          0.4.0
 - PDMats                        0.3.1

julia> Pkg.add("Compat")
INFO: Nothing to be done

julia> using Compat

julia> bitrand()
ERROR: bitrand not defined

Upvotes: 5

Views: 2907

Answers (1)

IainDunning
IainDunning

Reputation: 11664

This definitely works for me on Julia v0.3.3 with Compat.jl v0.2.10, so can you do the following:

  1. Pkg.rm("Compat")
  2. Run readdir(Pkg.dir()) to confirm its gone
  3. Pkg.update()
  4. Pkg.add("Compat") with a capital C
  5. Close and re-open Julia, just to be sure
  6. using Compat

Upvotes: 5

Related Questions