# Teaching Julia prerequisites

**URL:** <https://discourse.julialang.org/t/teaching-julia-prerequisites/28379>\
**Category:** Teaching & Outreach\
**Created:** [September 4, 2019, 5:00pm UTC](https://discourse.julialang.org/t/teaching-julia-prerequisites/28379 "2019-09-04T17:00:19Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ahmed\_Salih](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ahmed_salih/32/206579_2.png) [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Post date:** [September 4, 2019, 5:00pm UTC](https://discourse.julialang.org/t/teaching-julia-prerequisites/28379/1 "2019-09-04T17:00:19Z")

</div>

Hello all!

My question is basically, to those who are teaching Julia currently, how are you going about setting the fundementals up (ie. software) to ensure that your students (with no previous programming experience) gets a plesant experience? So like are you;

- Providing them with some kind of installation guide?
- Using some kind of server/webapplication to let the students use Julia?
- Do you provide them with a .zip file holding the release of Julia / GUI etc.?

Currently I am not interested in what kind of topics you usually teach, but just your approaches to setup an enviroment which makes it easy for the students to start using Julia.

I hope my question is clear enough, basically I just want to know what kind of setups you used and which you found succes/failure with and so forth.

Kind regards

---

<div class="post-metadata">

**Author:** ![dmolina](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dmolina/32/5246_2.png) [@dmolina](https://discourse.julialang.org/u/dmolina)\
**Post date:** [September 4, 2019, 7:13pm UTC](https://discourse.julialang.org/t/teaching-julia-prerequisites/28379/2 "2019-09-04T19:13:08Z")

</div>

I have not yet teach Julia, but I have teach Python for scientific field, and in my opinion a good option for Julia could be:

- Give them the last version in a zip to install them ( but it is because sometimes). It is important depending of the Internet velocity. In the julia case, you can provide them a julia environment with the packages. Another option could be a virtual machine or docker.
- The Jupyter environment is good enough for teaching, you can recommend an IDE but for a more interactive teaching using IJulia could be enough.

---

<div class="post-metadata">

**Author:** ![Nosferican](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nosferican/32/9275_2.png) [@Nosferican](https://discourse.julialang.org/u/Nosferican)\
**Post date:** [September 5, 2019, 12:56am UTC](https://discourse.julialang.org/t/teaching-julia-prerequisites/28379/3 "2019-09-05T00:56:29Z")

</div>

Containers! The best would likely be to get a solid battle-tested good container for the students to use. On that note, make sure they all use contained environments per project.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [September 5, 2019, 7:20am UTC](https://discourse.julialang.org/t/teaching-julia-prerequisites/28379/4 "2019-09-05T07:20:21Z")

</div>

I think that setting up a Jupyter server, preferably in-house, is the best way to do this.

You can of course also allow/recommend that students use their own machines, with their favorite IDE etc, but there should be an environment that Just Works.

---

<div class="post-metadata">

**Author:** ![Ahmed\_Salih](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ahmed_salih/32/206579_2.png) [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Post date:** [September 5, 2019, 10:32am UTC](https://discourse.julialang.org/t/teaching-julia-prerequisites/28379/5 "2019-09-05T10:32:37Z")

</div>

What is a container? Could you explain it a bit, and link to some good ressources?

Kind regards

---

<div class="post-metadata">

**Author:** ![Ahmed\_Salih](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ahmed_salih/32/206579_2.png) [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Post date:** [September 5, 2019, 10:34am UTC](https://discourse.julialang.org/t/teaching-julia-prerequisites/28379/6 "2019-09-05T10:34:01Z")

</div>

Yes, I also really liked that Jupyter allowed to include text / code etc. but it seemed to run a bit slow sometimes. I think a good balance would be to teach using Jupyter and then letting students utilize Julia on their own machine, using some kind of predecided interface.

Kind regards

---

<div class="post-metadata">

**Author:** ![Losses](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/losses/32/9175_2.png) [@Losses](https://discourse.julialang.org/u/Losses)\
**Post date:** [September 5, 2019, 10:43am UTC](https://discourse.julialang.org/t/teaching-julia-prerequisites/28379/7 "2019-09-05T10:43:26Z")

</div>

Docker is a good choice, but config a docker with pre-installed packages is pretty painful, I’m currently using a self-made container to calculate my data, but there always be a bunch of problem (related to permission problem)…  
Checkout the official docker: [Docker Hub](https://hub.docker.com/_/julia)

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [September 5, 2019, 11:44am UTC](https://discourse.julialang.org/t/teaching-julia-prerequisites/28379/8 "2019-09-05T11:44:28Z")

</div>

> [@Losses](#):
>
> config a docker with pre-installed packages is pretty painful

I don’t see why, you just install them in the `Dockerfile` like everything else.

---

<div class="post-metadata">

**Author:** ![Losses](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/losses/32/9175_2.png) [@Losses](https://discourse.julialang.org/u/Losses)\
**Post date:** [September 5, 2019, 12:10pm UTC](https://discourse.julialang.org/t/teaching-julia-prerequisites/28379/9 "2019-09-05T12:10:37Z")

</div>

😂 If you are trying to build a docker that include R/Julia/Python 3.7/MATLAB at the same time with commonly used packages, things will be really painful…  
Say, the problem I met:  
I want to build a docker with the following packages preinstalled: `GLM DSP FFTW RCall` etc…, so i built the following script:

```julia
#! /usr/local/julia-1.1.1/bin/julia

using Pkg

function recompile()
    for pkg in Pkg.installed()
        try
            pkgsym = Symbol(pkg[1])
            eval(:(using $pkgsym))
        catch
            println("ERROR!")
        end
    end
end

Pkg.add(map(x->string(x), ARGS))
recompile()

```

It’s pretty straight forward, install the package via

```julia
RUN install2.jl FFTW RCall RData Glob DataFrames Parameters JLD Suppressor MultivariateStats

```

now everything is installed and pre-compiled, but you’ll met permission problem if not using root user while loading the packages in your script, so we need:

```julia
RUN chmod -R ugo+r+x /usr/local/julia-1.1.1

```

Everything works well until you tried to install some packages that dependent on these pre-installed packages, there will be errors, and I have to install the package with `sudo julia`. And loading the package while you don’t have super user permission, there’ll be new problem.

I don’t know how the package manager works, but I really met a bunch of problems 😂

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [September 5, 2019, 12:26pm UTC](https://discourse.julialang.org/t/teaching-julia-prerequisites/28379/10 "2019-09-05T12:26:13Z")

</div>

> [@Losses](#):
>
> trying to build a docker that include R/Julia/Python 3.7/MATLAB at the same time with commonly used packages, things will be really painful…

I don’t know about Matlab, but R is prepackaged for eg Ubuntu/Debian, and all the other distros, Python ditto, and downloading and extracting Julia is straightforward.

In any case, the suggestion was about creating a Docker image with _Julia_, which is fairly simple.

> [@Losses](#):
>
> now everything is installed and pre-compiled, but you’ll met permission problem if not using root user

Either use the docker image as the default (root) user (it’s a sandbox, can’t do any harm), or create a user and install Julia as that user.

Creating a Docker image with a preinstalled & precompiled set of Julia packages is something that should be fairly easy for an IT department that otherwise uses Docker.

---

<div class="post-metadata">

**Author:** ![Nosferican](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nosferican/32/9275_2.png) [@Nosferican](https://discourse.julialang.org/u/Nosferican)\
**Post date:** [September 5, 2019, 12:49pm UTC](https://discourse.julialang.org/t/teaching-julia-prerequisites/28379/11 "2019-09-05T12:49:33Z")

</div>

The idea is to have reproducible environment readily accessible for each of the students so all the kinks can be worked out consistently (e.g., permissions, path to installing packages, etc.). As an added benefit, it is something widely used in research labs, academia, industry, and such. There is a bit of an investment to figure out the right image to use. From the latest community surveys, a very small percent of the downloads were from Docker. My research lab is currently working on improving the images we use for development in Julia. UVA uses the  
[https://github.com/OSC/Open-OnDemand](https://github.com/OSC/Open-OnDemand)  
which allows to spawn interactive apps such as Jupyter lab and RStudio (it also allows local authentication which makes our data architecture person happy 🙂 ). I have opened an [issue](https://github.com/OSC/Open-OnDemand/issues/62) for including other IDE such as Atom and VS Code which would make developing in Julia even nicer, but Jupyter lab is commonly used for teaching. Another example of using containers for teaching with Julia is from QuantEcon  
[https://lectures.quantecon.org/jl/](https://lectures.quantecon.org/jl/)

---

<div class="post-metadata">

**Author:** ![Ahmed\_Salih](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ahmed_salih/32/206579_2.png) [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Post date:** [September 5, 2019, 6:54pm UTC](https://discourse.julialang.org/t/teaching-julia-prerequisites/28379/12 "2019-09-05T18:54:12Z")

</div>

Thanks for the explanation! Exciting to hear how others do it. I will keep these different approaches in mind for the future.

Kind regards

---

<div class="post-metadata">

**Author:** ![fabgrei](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fabgrei/32/4214_2.png) [@fabgrei](https://discourse.julialang.org/u/fabgrei)\
**Post date:** [September 7, 2019, 5:59pm UTC](https://discourse.julialang.org/t/teaching-julia-prerequisites/28379/13 "2019-09-07T17:59:35Z")

</div>

Thanks for the hint!

For future readers, here’s a link to the relevant section of the relevant QuantEcon lecture: [https://lectures.quantecon.org/jl/more\_julia/tools\_editors.html#Docker](https://lectures.quantecon.org/jl/more_julia/tools_editors.html#Docker)

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [September 7, 2019, 6:20pm UTC](https://discourse.julialang.org/t/teaching-julia-prerequisites/28379/14 "2019-09-07T18:20:28Z")

</div>

IMO, containers are the worst thing to do since it’s shielding the both the students and yourself from reality. Instead, have them install Julia and use Julia with the online instructions. Are the online instructions giving your students trouble? Change them by PRing to:

[https://github.com/JuliaLang/www.julialang.org](https://github.com/JuliaLang/www.julialang.org)

See an issue with the documentation? Change it by PRing to:

[https://github.com/JuliaLang/julia/tree/master/doc](https://github.com/JuliaLang/julia/tree/master/doc)

Are there not enough tutorials for the packages you’re interested in? Write one. Package doesn’t install on the first try? PR to fix it (or at least open a very good issue describing exactly what the error is so that way others who get it know what it is!).

IMO, this is easier to do than getting a Docker running anyways.

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [September 7, 2019, 6:36pm UTC](https://discourse.julialang.org/t/teaching-julia-prerequisites/28379/15 "2019-09-07T18:36:13Z")

</div>

> [@ChrisRackauckas](#):
>
> IMO, containers are the worst thing to do since it’s shielding the both the students and yourself from reality.

Couldn’t agree more. For our Julia based lectures and Julia workshops we switched from a boxed solution to having students install Julia and Jupyter themselves. Although there are always individual problems in the beginning (which are mostly related to python as we use PyPlot.jl), it really pays off in the long run for both students (and teachers). Most importantly, they will be able to scale their Julia computations; to a supercomputer for example.

(EDIT: We created instruction [videos](http://www.thp.uni-koeln.de/trebst/Lectures/CompPhys-2019/julia_windows.mp4) and [pdfs](http://www.thp.uni-koeln.de/trebst/Lectures/CompPhys-2019/julia_windows.pdf) for all OSs (in german))

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [September 7, 2019, 6:43pm UTC](https://discourse.julialang.org/t/teaching-julia-prerequisites/28379/16 "2019-09-07T18:43:34Z")

</div>

> [@ChrisRackauckas](#):
>
> Are there not enough tutorials for the packages you’re interested in? Write one. Package doesn’t install on the first try? PR to fix it

Generally I agree with this attitude, but

1. the required improvements to make everything super easily and robustly installable may be beyond the resources of a few individuals within a short timeframe, so this is not practical for a course starting in the near future,

2. glitches do happen despite best efforts, and the instructor & TAs may not have the resources to deal with them.

Most university courses which teach some kind of programming make at least _one_ supported working environment available, on machines managed by the institution. A Jupyter server, or some kind of an environment using a Docker image is a possible implementation for this (both require some work from IT though).

If, in addition, some students prefer to install Julia on their own machines, that is a win-win situation since they free resources (running Jupyter with tons of parallel users can be demanding). But having a fallback option that is under institutional control, works 99% of the time, and gets support from IT is also valuable.

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [September 7, 2019, 6:50pm UTC](https://discourse.julialang.org/t/teaching-julia-prerequisites/28379/17 "2019-09-07T18:50:30Z")

</div>

FWIW, we make sure that everything is preinstalled and running in the computer pool of the institute as a backup (which is easy because there are admins that do 90% of the work and all computers are identical).

Let me say that I think that container solutions often are even more work on the instructor / TAs shoulders since a) it takes quite some time to create the container and b) if something doesn’t work / is missing they are the only ones who can fix things.

---

<div class="post-metadata">

**Author:** ![oschulz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oschulz/32/2998_2.png) [@oschulz](https://discourse.julialang.org/u/oschulz)\
**Post date:** [September 7, 2019, 6:53pm UTC](https://discourse.julialang.org/t/teaching-julia-prerequisites/28379/18 "2019-09-07T18:53:34Z")

</div>

Here’s our Julia+Anaconda container, is being actively used by quite a few people:

[https://cloud.docker.com/u/mppmu/repository/docker/mppmu/julia-anaconda](https://cloud.docker.com/u/mppmu/repository/docker/mppmu/julia-anaconda)

Source for latest version is here:

[https://github.com/mppmu/mppmu\_julia-anaconda\_img/tree/cuda101-julia12-anaconda3201903](https://github.com/mppmu/mppmu_julia-anaconda_img/tree/cuda101-julia12-anaconda3201903)

There’s versions with and without CUDA. We build with Docker, and run with Singularity, Shifter or Docker, depending on environment.are

---

<div class="post-metadata">

**Author:** ![oschulz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oschulz/32/2998_2.png) [@oschulz](https://discourse.julialang.org/u/oschulz)\
**Post date:** [September 7, 2019, 6:55pm UTC](https://discourse.julialang.org/t/teaching-julia-prerequisites/28379/19 "2019-09-07T18:55:51Z")

</div>

Actually, our users use this (more project-specific) container

[https://cloud.docker.com/u/legendexp/repository/docker/legendexp/legend-base](https://cloud.docker.com/u/legendexp/repository/docker/legendexp/legend-base)

[https://github.com/legend-exp/legendexp\_legend-base\_img](https://github.com/legend-exp/legendexp_legend-base_img)

It’s built on top of the aforementioned “mppmu/julia-anaconda” container.

---

<div class="post-metadata">

**Author:** ![Nosferican](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nosferican/32/9275_2.png) [@Nosferican](https://discourse.julialang.org/u/Nosferican)\
**Post date:** [September 8, 2019, 12:23am UTC](https://discourse.julialang.org/t/teaching-julia-prerequisites/28379/20 "2019-09-08T00:23:28Z")

</div>

> [@ChrisRackauckas](#):
>
> IMO, containers are the worst thing to do since it’s shielding the both the students and yourself from reality.

In my experience containers are the “reality” and working on local machines more of the exception. At least in many fields it is pretty standard to use containers for most of the work especially for a wide range of security level environments. It is also pretty common to use containers for accessing computing power (big memory, big parallel, high computing, etc.) It may be a combination of experiences, but I don’t think the premise that containers are not used in “reality” hold.

[Next page](https://discourse.julialang.org/t/teaching-julia-prerequisites/28379.md?page=2)
