How to handle dependencies?


so imagen I have a file at /home/pascal/projects/foo/main.jl and in that file I want to create code that plots some kind of histogram. For that, I want to use histogram() from the DistPlots package. I have a REPL session running in a terminal and do using Revise and includet("main.jl") to start watching the main.jl file.

Now it seems that I have to do using DistPlots inside the REPL session and also make use I don’t have any using in main.jl to be able to actually get the code running.

So how exactly do I handle dependencies like DistPlots? Can I somehow declare them in the file like one would do in Python, C, C++ etc.? Do I maybe need to first install them locally like one would do it for NodeJS? Like what’s the philosophy Julia is following here?

And as a side question (which also might be a nice input to my confusion here): How would I distribute my code once I’m done?

You are in luck, Julia has excellent dependency management. You should read the Pkg documentation here. Let us know if you have more questions after having read it. It’s a bit complicated but its very robust.

1 Like

I read through it and also discussed it in the slack. I actually run into a problem with Revise which added to my confusion. I think I’m good now. Thanks