Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I reinstall or recompile already installed packages in Julia?

Tags:

julia

Is it possible to reinstall or recompile an already installed package in Julia? I did not find any hints in the official documentation. whos() did not reveal anything useful either.

Best


As was pointed out in the answer below by @ivarne my question can also be understood as:

"How can I reload a package that has been loaded with import or using in a Julia session?"

This question has also been answered by @ivarne.

like image 946
lord.garbage Avatar asked May 05 '14 08:05

lord.garbage


People also ask

How do I uninstall packages in Julia?

When you decide that you don't want to have a package around any more, you can use Pkg. rm() to remove the requirement for it from the REQUIRE file: julia> Pkg. rm("Distributions") INFO: Removing Distributions v0.

Where does Julia Look for packages?

Julia uses git for organizing and controlling packages. By convention, all packages are stored in git repositories, with a ". jl" suffix. So the Calculus package is stored in a Git repository called Calculus.

How do I open package manager in Julia?

Enter the Pkg REPL by pressing ] from the Julia REPL. To get back to the Julia REPL, press backspace or ^C.


2 Answers

You can re-run the package build script with Pkg.build("pkgname"). The actual compiling of the packages is just in time so they are complied when you load them.

like image 126
Mr Alpha Avatar answered Sep 22 '22 01:09

Mr Alpha


Not sure about the terminology you use, but if you think about reloading a package (with import or using), it is complicated and the best approach is to restart Julia.

A function called reload() exists, but it has some limitations. While developing a Package, you might consider using something like the Autoreload.jl package to make it easier to reload the files you are working on.

like image 37
ivarne Avatar answered Sep 20 '22 01:09

ivarne