I think avoiding environments causes a lot more grief than it saves (if it indeed saves any).
Right, anyway thereâs a 1 page handout that explains what to do, and then youâre done.
The students are likely all on Windows and canât start julia
like that on the command line.
I was replying to
so I guess it was assumed that they can. The desktop shortcut is a convenience that can also be a bit of a hindrance
I wonder if there could be a âright-clickâ context menu for folders like Git Bash and VS Code install, something like âOpen Julia hereââŚ
It seems to me if you are going to teach people Julia you should have them install vscode and then itâs just a matter of opening the folder they want to work in and launching Julia from there. Actually launching Julia directly would be deemphasized
This is interesting. These students are only using Julia for the first time, so they would have loaded everything just using Pkg.add and (presumably) gotten the current versions of everything, so I canât see how the older version would have been loaded. I suggested these students with issues run Pkg.update() but that didnât help. However I will check their versions. [Thanks]
I agree; just trying to consider things from the perspective of someone who has only used Windows and interacted just in GUIs. Adding something like
import Pkg; Pkg.activate(@__DIR__)
and so on at the top of scripts might help in some cases with proper instruction.
When I find one of these cases, I spend 15 minutes (max.) trying to solve their problems. If we canât solve the problem, I have an workspace in Deepnote with Julia and all the needed packages. They can create an account and access to that workspace.
There are two limitations. First, because we are using free academic accounts the speed is not great (but itâs not a big problem in our case). Second, we use Pluto, but Deepnote is closer to Jupyter, so there a few things to adapt for them.
Thanks, that seems a good idea. I had previously considered doing that for the whole class and ruled it out, but the idea of using that as a backup hadnât occurred to me.
Is there one of these online? I might have a look to see if it could be appropriate for this group.
It would have to be very simple/basic.
Alternatively, since this class will only ever be using a couple of packages, what about having students just delete the .toml files (or delete all packages some other easier way) and start from scratch whenever they have a problem? Will that work?
I am teaching with Julia (in fact my fourth winter course), students have very diverse background regarding âhacking abilityâ and operating systems. I use Pluto notebooks throughout, and since last year (with the inbuilt package manager) this goes very smooth. Students just need to be able to install Julia, add and use Pluto.jl and start Pluto.
To save students from long TTFP I use PyPlot, and made PlutoVista.jl which calls back to Javascript for graphics.
With the recent speed-up in compilation times Plots seems to be viable now in this respect.
Some care with package choice is necessary - you would need to check if binary packages used are up-to-date and managed by BinaryBuilder, and really have precompiled versions for all OSes. However, the only way to establish this information in the momennt seems to be to look at the Project.tomlâs and at the releases of the jll packages.
For this special case you can delete the .julia folder which resides in C:\Users\user-name
where user-name is that of the logged in Windows user.
The special case is, that you donât have anything in .julia which is needed or used by the new students at the beginning of the class. So deleting .julia is ok at the beginning and lets you start with a complete new julia.
THIS IS NOT RECOMMENDED IN GENERAL: because you loose packages in development and whatever you need in config/startup.jl for example!
ANOTHER CAVEAT: if you install Julia using juliaup, you need to reinstall julia after deleting .julia, because the Julia binaries are put into .julia with juliaup. If you installed Julia just by downloading the installation files from Download Julia you donât need to reinstall Julia.
Thank you. It would be handy (a âwishlistâ item?) if there were a Pkg.reset() function which would restore to a fresh state without risking the reinstallation issues you mention.
Or making this the first thing to learn for the students:
- cleanup (remove or rename c:\Users\username\.julia)
- download and install fresh Julia
I think, itâs not so bad to know from the beginning, where Julia stuff is happening on the file system.
This is fixed on the upcoming 1.6 so it should at leat not happen anymore after that.
Sorry, I realize this is old, but I didnât see it at the time.
I definitely still had this happen to me in 1.6.x (i.e. registry corruption from Julia being killed or interrupted during registry updates). I also semi-regularly got corrupted REPL history files.
However, I have not yet seen either of these issues in several months of using 1.8.x.
I think it has to do with the order in which packages are added. The later a new package is added, the more chance there will be a dependency issue introduced. It seems that âproblematicâ packages (like JuMP and Plots, and probably CSV) should be added early to avoid issues. Once they work, there seems to be less chance of them breaking.
This is exactly the point I was trying to make about the importance of environments. Pkg doesnât give you the latest everything it gives you something that is compatible with all the things. When I started using Julia and just installed everything into the top level environment I was getting packages that were YEARS out of date due to compatibility resolution.
Environments are not just ânice to haveâ they are essential to making Julia work. You canât really know whatâs going to happen if you install everything into the top level environment in some random order.
Right. The order that packages are added does not matter. All that matters for dependency resolution is what the current set of projects in the Project.toml is. You can have weird cases where dependency resolution picks a very old version of a package, perhaps because the old version did not have correctly chosen compatibility bounds.
When you are learning Java for the first time, the line public static void main
is just black magic. And thatâs fine. As long as directions are clear people can recite anything, I would guess.