Viewing the Notebooks Locally

To view the notebooks locally and interact with the contents, use the following commands (requires IJulia):

given in the following link

Pkg.clone(“https://github.com/JuliaDiffEq/DiffEqTutorials.jl”)
using IJulia
notebook(dir=Pkg.dir(“DiffEqTutorials”))

But I get the following alerts:

Need your guidance. And help

Hermes

Looks like it’s been reported already: https://github.com/JuliaDiffEq/DiffEqTutorials.jl/issues/31

This has now been updated with a v1.0-friendly way of doing it:

using Pkg
#Pkg.add("IJulia") # Need to do this the first time to install IJulia!
pkg"add https://github.com/JuliaDiffEq/DiffEqTutorials.jl"
using IJulia, DiffEqTutorials
notebook(dir = joinpath(dirname(pathof(DiffEqTutorials)),".."))

@StefanKarpinski, can you chime in on whether there’s a better way of doing this kind of thing with v1.0? Essentially it’s a project that I want to share and have people edit (since it’s a notebook to play with). On v0.6 it would dirty repos, is v1.0 safe for this since they aren’t working in a repo if it’s add?

Doesn’t it create a new directory ~/.julia/packages/DiffEqTutorials/xxxxxx every time DiffEqTutorials is updated (and ]up is run)? Not sure if that’s desired or not though.

Yeah it does. But it’s at least safe? I’m not sure if there’s a more standard Pkg3 way to handle this.

FWIW, after https://github.com/JuliaLang/Pkg.jl/pull/785, files in packages are read-only when added.

When I run the updated commands:
I receive the following alert:

Blockquote
using Pkg
#Pkg.add(“IJulia”) # Need to do this the first time to install IJulia!
pkg"add https://github.com/JuliaDiffEq/DiffEqTutorials.jl"
using IJulia, DiffEqTutorials
notebook(dir = joinpath(dirname(pathof(DiffEqTutorials)),"…"))

Updating registry at C:\Users\user\.julia\registries\General
Updating git-repo https://github.com/JuliaRegistries/General.git
[1mFetching: [========================================>] 99.9 %0.0 %] 13.4 %> ] 36.4 %Fetching: [====================> ] 49.8 %======================> ] 54.2 %] 67.5 % [=================================> ] 80.8 %6 %>] 98.0 % Cloning git-repo https://github.com/JuliaDiffEq/DiffEqTutorials.jl
[1mFetching: [==================> ] 43.6 %0.0 %

failed to clone from https://github.com/JuliaDiffEq/DiffEqTutorials.jl, error: GitError(Code:ERROR, Class:OS, failed to read data: A security error occurred
)

Blockquote

When I run the updated commands

using Pkg
#Pkg.add(“IJulia”) # Need to do this the first time to install IJulia!
pkg"add https://github.com/JuliaDiffEq/DiffEqTutorials.jl"
using IJulia, DiffEqTutorials
notebook(dir = joinpath(dirname(pathof(DiffEqTutorials)),"…"))

I receive the following alert:

Updating registry at `C:\Users\user\.julia\registries\General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
[1mFetching: [========================================>]  99.9 %0.0 %]  13.4 %>                         ]  36.4 %Fetching: [====================>                    ]  49.8 %======================>                  ]  54.2 %]  67.5 % [=================================>       ]  80.8 %6 %>]  98.0 %   Cloning git-repo `https://github.com/JuliaDiffEq/DiffEqTutorials.jl`
[1mFetching: [==================>                      ]  43.6 %0.0 %

failed to clone from https://github.com/JuliaDiffEq/DiffEqTutorials.jl, error: GitError(Code:ERROR, Class:OS, failed to read data: A security error occurred
)

So @kristoffer.carlsson is the correct recommendation to tell users to dev here?

Are you able to clone other packages? That looks like a network issue.

Since DiffEqTutorials.jl is not a julia package (it contains no code) it seems easiest to just tag a release and tell people to download the zip / tarball. Or use git clone. Since it is not a package it doesn’t seem beneficial to include the package manager at all.

When running the code from Atom, everything works correctly,
From%20Atoma0
And Jumper opens correctly. And everything works.
From%20Atom

Not so if I run from Julia

Using Ijulia
notebook ()

And in a new notebook I paste the code and run it.
From%20Juliua%40Jupyter

How do you download and upzip the tarballs using a Julia package command? Let me make sure there’s not an X-Y problem here: I just want to deploy some notebooks to users with some simple 1-2 lines of Julia code that would run on any basic installation. I don’t care if it’s a package manager command or not, I was just using the package manager since I’m not sure how to download the repo’s master using Base Julia without it.

The commands that are given open up a new notebook at the directory. If you already have notebooks open, just go to the directory where DiffEqTutorials is downloaded to and you’ll find the notebooks there.

My point was just that the package manager was written to manage packages

LibGit2.clone("https://github.com/JuliaDiffEq/DiffEqTutorials.jl", "DiffEqTutorials") or something? But dev from Pkg would probably also work, its just a bit odd since you assume that installs a package.

FWIW, I think it makes sense to bundle a Project + Manifest so that users can install the exact versions of the packages the notebook was built for. Full deployment could then be

LibGit2.clone("https://github.com/JuliaDiffEq/DiffEqTutorials.jl", "DiffEqTutorials")
cd("DiffEqTutorials")
Pkg.activate(".")
Pkg.instantiate()
2 Likes