Trying to download a package in Julia

I would like to use the bitrand() function, 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 information, I am using Julia-0.3.2 . Thanks!

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 
+5
source share
1 answer

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

  • Pkg.rm("Compat")
  • Run readdir(Pkg.dir()) to confirm its absence.
  • Pkg.update()
  • Pkg.add("Compat") with capital C
  • Close and open Julia to be sure.
  • using Compat
+5
source

Source: https://habr.com/ru/post/1212751/


All Articles