To be able to edit code and run cells, you need to run the notebook yourself. Where would you like to run the notebook?

In the cloud (experimental)

Binder is a free, open source service that runs scientific notebooks in the cloud! It will take a while, usually 2-7 minutes to get a session.

On your computer

(Recommended if you want to store your changes.)

  1. Copy the notebook URL:
  2. Run Pluto

    (Also see: How to install Julia and Pluto)

  3. Paste URL in the Open box

Frontmatter

If you are publishing this notebook on the web, you can set the parameters below to provide HTML metadata. This is useful for search engines and social media.

Author 1
👀 Reading hidden code
import Pkg
200 μs
👀 Reading hidden code
begin
ctx = Pkg.Types.Context(env=Pkg.Types.EnvCache(joinpath(mktempdir(),"Project.toml")))
Pkg.add(ctx, [Pkg.PackageSpec(name="JSON")])
end
❔
    Updating registry at `~/.julia/registries/General.toml`
   Resolving package versions...
    Updating `/tmp/jl_hkRPaz/Project.toml`
  [682c06a0] + JSON v0.21.4
    Updating `/tmp/jl_hkRPaz/Manifest.toml`
  [682c06a0] + JSON v0.21.4
  [69de0a69] + Parsers v2.8.3
  [aea7be01] + PrecompileTools v1.2.1
  [21216c6a] + Preferences v1.4.3
  [ade2ca70] + Dates
  [a63ad114] + Mmap
  [de0858da] + Printf
  [9a3f8284] + Random
  [ea8e919c] + SHA
  [9e88b42a] + Serialization
  [fa267f1f] + TOML
  [cf7118a7] + UUIDs
  [4ec0a83e] + Unicode
1.4 s
👀 Reading hidden code
ctx.env.project
15.2 μs
👀 Reading hidden code
ctx.env.manifest
16.3 μs
Error message

MethodError: Cannot `convert` an object of type String to an object of type Pkg.Types.Compat

Closest candidates are:

convert(::Type{T}, ::T) where T at /opt/hostedtoolcache/julia/1.7.3/x64/share/julia/base/essentials.jl:218

Pkg.Types.Compat(::Any, ::Any) at /opt/hostedtoolcache/julia/1.7.3/x64/share/julia/stdlib/v1.7/Pkg/src/Types.jl:220

Stack trace

Here is what happened, the most recent locations are first:

  1. setindex!(h::Dict{String, Pkg.Types.Compat}, v0::String, key::String)
  2. updated = let	ctx.env.project.compat["JSON"] = "^0.21.1"	ctx.env.project
updated = let
ctx.env.project.compat["JSON"] = "^0.21.1"
ctx.env.project
end
👀 Reading hidden code
---
"/tmp/jl_XgBF7i"
pt = tempname()
👀 Reading hidden code
49.5 μs
Error message

Another cell defining updated contains errors.

updated_2 = let
updated
Pkg.Types.write_env(ctx.env)
end;
👀 Reading hidden code
---
Error message

Another cell defining updated contains errors.

¯\_(ツ)_/¯
let
updated_2
Text(read(ctx.env.project_file, String))
end
👀 Reading hidden code
---
Error message

Another cell defining updated contains errors.

let
updated_2
Text(read(ctx.env.manifest_file, String))
end
👀 Reading hidden code
---
false
isfile("/System/Volumes/Data/home/fons/Documents/Pluto.jl/Project.toml")
👀 Reading hidden code
25.5 μs
Pkg.Types.Context(env=Pkg.Types.EnvCache("/Users/fons/Documents/Pluto.jl/Project.toml"))
👀 Reading hidden code
244 μs